Skip to content

Commit

Permalink
Renaming in favorites fixes (#37)
Browse files Browse the repository at this point in the history
* Bump version to 0.115.0 [release]

* Migration file which adds alias column to favorites table

* Update package versions

* Added renameFavorite method which updates alias column in favorites table

* Extended new Favorite model with alias column

* Rename favorite fixes

---------

Co-authored-by: GitHub Release <>
Co-authored-by: Stanislav Kiselev <“[email protected]”>
  • Loading branch information
stankis and Stanislav Kiselev authored Dec 8, 2023
1 parent c24f69f commit 9d25fa0
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 9d25fa0

Please sign in to comment.