implemented location edit

This commit is contained in:
2024-01-05 14:52:32 +01:00
parent f26aae7d66
commit 3f7b681ab9
5 changed files with 200 additions and 12 deletions

View 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." />;

View 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} />);
}