optimizing DB projections
This commit is contained in:
@@ -7,7 +7,11 @@ export async function GET(request: Request, { params:{ id } }: { params: { id:st
|
||||
|
||||
const dbClient = await getDbClient();
|
||||
const location = await dbClient.collection<BillingLocation>("lokacije")
|
||||
.findOne({ _id: locationID });
|
||||
.findOne({ _id: locationID }, {
|
||||
projection: {
|
||||
utilBillsProofOfPaymentAttachment: 1,
|
||||
}
|
||||
});
|
||||
|
||||
if(!location?.utilBillsProofOfPaymentAttachment) {
|
||||
notFound();
|
||||
|
||||
Reference in New Issue
Block a user