implemented bill deletion + var rename

This commit is contained in:
2024-01-05 13:54:25 +01:00
parent 4ffe2de6ea
commit 86135199a9
12 changed files with 122 additions and 117 deletions

View File

@@ -0,0 +1,4 @@
import { NotFoundPage } from '@/app/ui/NotFoundPage';
export default () =>
<NotFoundPage title="404 Bill Not Found" description="Could not find the requested Bill." />;

View File

@@ -0,0 +1,12 @@
import { deleteBillById } from '@/app/lib/actions';
import { notFound, redirect } from 'next/navigation';
export default async function Page({ params:{ id } }: { params: { id:string } }) {
const [locationID, billID] = id.split('-');
if(await deleteBillById(locationID, billID) === 0) {
return(notFound());
}
redirect(`/`);
}