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');