diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-18 11:28:17 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 16:26:20 +0200 |
commit | 1735c825726edaa0af5035cb6cbb0cc0db502c6d (patch) | |
tree | 7bbb442f2cb4d7be58a4e08d87f5974403a3047c /server/helpers | |
parent | e8bafea35bc930cb8ac5b2d521a188642a1adffe (diff) | |
download | PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.gz PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.zst PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.zip |
Update sequelize
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/database-utils.ts | 5 |
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 | ||
69 | function resetSequelizeInstance (instance: Model<any>, savedFields: object) { | 69 | function 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 | ||