diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/database-utils.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts index 627381086..0e6b35503 100644 --- a/server/helpers/database-utils.ts +++ b/server/helpers/database-utils.ts | |||
@@ -78,10 +78,8 @@ function updateInstanceWithAnother <M, T extends U, U extends Model<M>> (instanc | |||
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | function resetSequelizeInstance (instance: Model<any>, savedFields: object) { | 81 | function resetSequelizeInstance <T> (instance: Model<T>) { |
82 | Object.keys(savedFields).forEach(key => { | 82 | instance.set(instance.previous()) |
83 | instance[key] = savedFields[key] | ||
84 | }) | ||
85 | } | 83 | } |
86 | 84 | ||
87 | function filterNonExistingModels <T extends { hasSameUniqueKeysThan (other: T): boolean }> ( | 85 | function filterNonExistingModels <T extends { hasSameUniqueKeysThan (other: T): boolean }> ( |