diff --git a/app/lib/actions/billActions.ts b/app/lib/actions/billActions.ts index 1d251f2..e4220af 100644 --- a/app/lib/actions/billActions.ts +++ b/app/lib/actions/billActions.ts @@ -238,7 +238,13 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI .findOne({ _id: location._id, "bills.name": billName - }, { projection: { "bills.$": 1 } }); + }, { + projection: { + "bills.$": 1, + "bills.attachment": 0, + "bills.barcodeImage": 0 + } + }); // Only add if bill with same name doesn't already exist if (!existingBill) { @@ -363,7 +369,12 @@ export const deleteBillById = withUser(async (user:AuthenticatedUser, locationID if (deleteInSubsequentMonths) { // Get the current location and bill to find the bill name and location name const location = await dbClient.collection("lokacije") - .findOne({ _id: locationID, userId }); + .findOne({ _id: locationID, userId }, { + projection: { + "bills.attachment.fileContentsBase64": 0, + "bills.barcodeImage": 0 + } + }); if (location) { const bill = location.bills.find(b => b._id === billID);