aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/__helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/models/__helpers.ts')
-rw-r--r--src/lib/models/__helpers.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/models/__helpers.ts b/src/lib/models/__helpers.ts
index 75737c5..049dc00 100644
--- a/src/lib/models/__helpers.ts
+++ b/src/lib/models/__helpers.ts
@@ -23,7 +23,7 @@ export function jsonObject(key: string): any {
};
}
-export function jsonArray(key: string): any {
+export function jsonArray(key: string, defaultValue: string[] = []): any {
return {
type: DataTypes.TEXT,
get: function (): string[] {
@@ -33,7 +33,7 @@ export function jsonArray(key: string): any {
return jsonParseSet.call(this, key, val);
},
allowNull: false,
- defaultValue: '[]'
+ defaultValue: JSON.stringify(defaultValue)
};
}