Answer the question
In order to leave comments, you need to log in
How to apply scope to update/save in sequelize when a value is returned as a result?
There are descriptions of scopes by roles in the model, for example, for the admin, we remove some fields from the result:
const scopes = {
admins: {
where: {
role: ROLES.ADMIN
},
attributes: {
exclude: ['xp', 'hp', 'mp', 'gold', 'lvl']
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question