19 lines
522 B
TypeScript
19 lines
522 B
TypeScript
import { fetchBillById } from '@/app/lib/actions/billActions';
|
|
import { BillEditForm } from '@/app/ui/BillEditForm';
|
|
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>
|
|
);
|
|
} |