From daa9b2a134400cdaec008012ccc6c142208b5b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Mon, 11 Aug 2025 13:58:57 +0200 Subject: [PATCH] locationAction: query optimization --- app/lib/actions/locationActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/actions/locationActions.ts b/app/lib/actions/locationActions.ts index 6414d44..7accab4 100644 --- a/app/lib/actions/locationActions.ts +++ b/app/lib/actions/locationActions.ts @@ -369,7 +369,7 @@ export const deleteLocationById = withUser(async (user:AuthenticatedUser, locati if (deleteInSubsequentMonths) { // Get the location name first to find all locations with the same name const location = await dbClient.collection("lokacije") - .findOne({ _id: locationID, userId }, { projection: { bills: 0 } }); + .findOne({ _id: locationID, userId }, { projection: { name: 1 } }); if (location) { // Delete all locations with the same name in current and subsequent months