From 8e02138fc850b7fd534a14f61b6cac150e7d38f7 Mon Sep 17 00:00:00 2001 From: Guido Percu Date: Tue, 22 Apr 2025 10:25:34 -0400 Subject: [PATCH] Add userId to ConditionExpression query --- backend/src/reports/reports.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/reports/reports.service.ts b/backend/src/reports/reports.service.ts index 561b5e12..f8681b3a 100644 --- a/backend/src/reports/reports.service.ts +++ b/backend/src/reports/reports.service.ts @@ -427,6 +427,7 @@ export class ReportsService { id, }), UpdateExpression: 'SET bookmarked = :bookmarked, updatedAt = :updatedAt', + ConditionExpression: 'userId = :userId', // Add condition to ensure we're updating the right user's report ExpressionAttributeValues: marshall({ ':bookmarked': bookmarked, ':updatedAt': new Date().toISOString(),