aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/database-utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/database-utils.ts')
-rw-r--r--server/helpers/database-utils.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts
index 1005d2cf1..39c74b2fd 100644
--- a/server/helpers/database-utils.ts
+++ b/server/helpers/database-utils.ts
@@ -62,14 +62,13 @@ function updateInstanceWithAnother <T extends Model<T>> (instanceToUpdate: Model
62 const obj = baseInstance.toJSON() 62 const obj = baseInstance.toJSON()
63 63
64 for (const key of Object.keys(obj)) { 64 for (const key of Object.keys(obj)) {
65 instanceToUpdate.set(key, obj[key]) 65 instanceToUpdate[key] = obj[key]
66 } 66 }
67} 67}
68 68
69function resetSequelizeInstance (instance: Model<any>, savedFields: object) { 69function resetSequelizeInstance (instance: Model<any>, savedFields: object) {
70 Object.keys(savedFields).forEach(key => { 70 Object.keys(savedFields).forEach(key => {
71 const value = savedFields[key] 71 instance[key] = savedFields[key]
72 instance.set(key, value)
73 }) 72 })
74} 73}
75 74