From e801f18bb4b8ab03b55c8a0c13128154576d12a7 Mon Sep 17 00:00:00 2001 From: Stanislav Kiselev <“staskis@yandex-team.ru”> Date: Fri, 8 Dec 2023 12:52:41 +0300 Subject: [PATCH] Rename favorite fixes --- src/db/models/favorite/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/db/models/favorite/index.ts b/src/db/models/favorite/index.ts index 7c1c29be..cee2419f 100644 --- a/src/db/models/favorite/index.ts +++ b/src/db/models/favorite/index.ts @@ -386,10 +386,13 @@ class Favorite extends Model { validateRenameFavorite({entryId, name}); + const {login} = requestedBy; + const result = await Favorite.query(this.primary) - .where({entryId}) .update({alias: name}) + .where({entryId, tenantId, login}) .returning('*') + .first() .timeout(Model.DEFAULT_QUERY_TIMEOUT); ctx.log('RENAME_FAVORITE_SUCCESS');