diff options
Diffstat (limited to 'src/lib/models/__helpers.ts')
-rw-r--r-- | src/lib/models/__helpers.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/models/__helpers.ts b/src/lib/models/__helpers.ts index b65c014..243b274 100644 --- a/src/lib/models/__helpers.ts +++ b/src/lib/models/__helpers.ts @@ -1,21 +1,21 @@ import { DataTypes, Model } from 'sequelize'; export const NEVER_USED = 'This should never be executed'; -export function jsonParseGet(key: string, that: Model): any { - return JSON.parse(that.getDataValue(key)); +export function jsonParseGet(this: Model, key: string): any { + return JSON.parse(this.getDataValue(key)); } -export function jsonParseSet(key: string, that: Model, value: any): any { - return that.setDataValue(key, JSON.stringify(value)); +export function jsonParseSet(this: Model, key: string, value: any): any { + return this.setDataValue(key, JSON.stringify(value)); } export function jsonArrayInit(key: string): any { return { type: DataTypes.TEXT, get: function (): string[] { - return jsonParseGet(key, this); + return jsonParseGet.call(this, key); }, set: function (val: string[]) { - return jsonParseSet(key, this, val); + return jsonParseSet.call(this, key, val); }, allowNull: false, defaultValue: '[]' |