Ignore sequelize hooks when updating user lastSeen on socket authentication

This commit is contained in:
advplyr 2023-11-24 14:27:32 -06:00
parent 572fb0993c
commit 7a9c869ac5
2 changed files with 5 additions and 3 deletions

View file

@ -99,11 +99,13 @@ class User extends Model {
* Update User from old user model
*
* @param {oldUser} oldUser
* @param {boolean} [hooks=true] Run before / after bulk update hooks?
* @returns {Promise<boolean>}
*/
static updateFromOld(oldUser) {
static updateFromOld(oldUser, hooks = true) {
const user = this.getFromOld(oldUser)
return this.update(user, {
hooks: !!hooks,
where: {
id: user.id
}