optimization: not fetching binary data if not needed

This commit is contained in:
2024-02-08 15:15:10 +01:00
parent 02e7aef100
commit db3b4abed5
3 changed files with 38 additions and 8 deletions

View File

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