Files
evidencija-rezija/app/bill/[id]/delete/page.tsx
2024-01-05 14:20:00 +01:00

12 lines
351 B
TypeScript

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