moved all the pages into [locale]
This commit is contained in:
6
app/[locale]/bill/[id]/delete/not-found.tsx
Normal file
6
app/[locale]/bill/[id]/delete/not-found.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { NotFoundPage } from '@/app/ui/NotFoundPage';
|
||||
|
||||
const BillNotFound = () =>
|
||||
<NotFoundPage title="404 Bill Not Found" description="Could not find the requested Bill." />;
|
||||
|
||||
export default BillNotFound;
|
||||
22
app/[locale]/bill/[id]/delete/page.tsx
Normal file
22
app/[locale]/bill/[id]/delete/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
import { fetchLocationById } from '@/app/lib/actions/locationActions';
|
||||
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
|
||||
import { BillDeleteForm } from '@/app/ui/BillDeleteForm';
|
||||
import { fetchBillById } from '@/app/lib/actions/billActions';
|
||||
import { Main } from '@/app/ui/Main';
|
||||
|
||||
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
||||
const [locationID, billID] = id.split('-');
|
||||
|
||||
const [location, bill] = await fetchBillById(locationID, billID) ?? [];
|
||||
|
||||
if (!location || !bill) {
|
||||
return(notFound());
|
||||
}
|
||||
|
||||
return (
|
||||
<Main>
|
||||
<BillDeleteForm location={location} bill={bill} />
|
||||
</Main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user