implemented bill deletion + var rename
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user