fix array save

This commit is contained in:
Simon Larsen 2023-10-24 11:32:02 +01:00
parent 842b0664c7
commit 81e4b4435c
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
2 changed files with 5 additions and 4 deletions

View File

@ -234,19 +234,19 @@ export default class StatementGenerator<TBaseModel extends AnalyticsBaseModel> {
} }
if (column.type === TableColumnType.ArrayNumber) { if (column.type === TableColumnType.ArrayNumber) {
value = `(${(value as Array<number>) value = `[${(value as Array<number>)
.map((v: number) => { .map((v: number) => {
return v; return v;
}) })
.join(', ')})`; .join(', ')}]`;
} }
if (column.type === TableColumnType.ArrayText) { if (column.type === TableColumnType.ArrayText) {
value = `(${(value as Array<string>) value = `[${(value as Array<string>)
.map((v: string) => { .map((v: string) => {
return `'${v}'`; return `'${v}'`;
}) })
.join(', ')})`; .join(', ')}]`;
} }
if(column.type === TableColumnType.JSON) { if(column.type === TableColumnType.JSON) {

View File

@ -292,6 +292,7 @@ router.post(
} }
} }
await MetricSumService.createMany({ await MetricSumService.createMany({
items: dbMetricsSum, items: dbMetricsSum,
props: { props: {