Files
evidencija-rezija/app/bill/[id]/edit/page.tsx
2024-01-16 10:24:21 +01:00

20 lines
560 B
TypeScript

import { fetchBillById } from '@/app/lib/actions/billActions';
import { BillEditForm } from '@/app/ui/BillEditForm';
import { Main } from '@/app/ui/Main';
import { notFound } from 'next/navigation';
export default async function Page({ params:{ id } }: { params: { id:string } }) {
const [locationID, billID] = id.split('-');
const bill = await fetchBillById(locationID, billID);
if (!bill) {
return(notFound());
}
return (
<Main>
<BillEditForm locationID={locationID} bill={bill} />
</Main>
);
}