aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-18 11:28:17 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:26:20 +0200
commit1735c825726edaa0af5035cb6cbb0cc0db502c6d (patch)
tree7bbb442f2cb4d7be58a4e08d87f5974403a3047c /server/helpers
parente8bafea35bc930cb8ac5b2d521a188642a1adffe (diff)
downloadPeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.gz
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.zst
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.zip
Update sequelize
Diffstat (limited to 'server/helpers')
-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