implemented location edit
This commit is contained in:
4
app/location/[id]/edit/not-found.tsx
Normal file
4
app/location/[id]/edit/not-found.tsx
Normal file
@@ -0,0 +1,4 @@
|
||||
import { NotFoundPage } from '@/app/ui/NotFoundPage';
|
||||
|
||||
export default () =>
|
||||
<NotFoundPage title="404 Location Not Found" description="Could not find the requested Location." />;
|
||||
18
app/location/[id]/edit/page.tsx
Normal file
18
app/location/[id]/edit/page.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { BillingLocation, Bill } from '@/app/lib/db-types';
|
||||
import { fetchBillById } from '@/app/lib/billActions';
|
||||
import clientPromise from '@/app/lib/mongodb';
|
||||
import { BillEditForm } from '@/app/ui/BillEditForm';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { LocationEditForm } from '@/app/ui/LocationEditForm';
|
||||
import { fetchLocationById } from '@/app/lib/locationActions';
|
||||
|
||||
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
||||
|
||||
const location = await fetchLocationById(id);
|
||||
|
||||
if (!location) {
|
||||
return(notFound());
|
||||
}
|
||||
return (<LocationEditForm location={location} />);
|
||||
}
|
||||
Reference in New Issue
Block a user