implemente bill add
This commit is contained in:
12
app/bill/[id]/delete/page.tsx
Normal file
12
app/bill/[id]/delete/page.tsx
Normal 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(`/`);
|
||||
}
|
||||
Reference in New Issue
Block a user