Update sequelize
This commit is contained in:
parent
e8bafea35b
commit
1735c82572
46 changed files with 389 additions and 421 deletions
|
@ -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]
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue