Skip to content

Commit

Permalink
Rename favorite fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Kiselev committed Dec 8, 2023
1 parent 29aed1d commit e801f18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/db/models/favorite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit e801f18

Please sign in to comment.