Update sequelize

This commit is contained in:
Chocobozzz 2019-04-18 11:28:17 +02:00
parent e8bafea35b
commit 1735c82572
No known key found for this signature in database
GPG key ID: 583A612D890159BE
46 changed files with 389 additions and 421 deletions

View file

@ -62,14 +62,13 @@ function updateInstanceWithAnother <T extends Model<T>> (instanceToUpdate: Model
const obj = baseInstance.toJSON()
for (const key of Object.keys(obj)) {
instanceToUpdate.set(key, obj[key])
instanceToUpdate[key] = obj[key]
}
}
function resetSequelizeInstance (instance: Model<any>, savedFields: object) {
Object.keys(savedFields).forEach(key => {
const value = savedFields[key]
instance.set(key, value)
instance[key] = savedFields[key]
})
}