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

@@ -1,10 +1,10 @@
import { fetchBillById } from '@/app/lib/fetchBillById';
import { fetchBillById } from '@/app/lib/actions';
import { notFound } from 'next/navigation';
export async function GET(request: Request, { params:{ id } }: { params: { id:string } }) {
const [invoiceID, billID] = id.split('-');
const [locationID, billID] = id.split('-');
const bill = await fetchBillById(invoiceID, billID);
const bill = await fetchBillById(locationID, billID);
if(!bill?.attachment) {
notFound();