@exulu/backend 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1645,7 +1645,7 @@ var updateStatistic = async (statistic) => {
|
|
|
1645
1645
|
const { db: db2 } = await postgresClient();
|
|
1646
1646
|
await db2.from("statistics").update({
|
|
1647
1647
|
total: db2.raw("total + ?", [statistic.count ?? 1]),
|
|
1648
|
-
timeseries: db2.raw(
|
|
1648
|
+
timeseries: db2.raw('CASE WHEN "createdAt" = ? THEN array_append(timeseries, ?) ELSE timeseries END', [currentDate, { date: currentDate, count: statistic.count ?? 1 }])
|
|
1649
1649
|
}).where({
|
|
1650
1650
|
name: statistic.name,
|
|
1651
1651
|
label: statistic.label,
|
package/dist/index.js
CHANGED
|
@@ -1603,7 +1603,7 @@ var updateStatistic = async (statistic) => {
|
|
|
1603
1603
|
const { db: db2 } = await postgresClient();
|
|
1604
1604
|
await db2.from("statistics").update({
|
|
1605
1605
|
total: db2.raw("total + ?", [statistic.count ?? 1]),
|
|
1606
|
-
timeseries: db2.raw(
|
|
1606
|
+
timeseries: db2.raw('CASE WHEN "createdAt" = ? THEN array_append(timeseries, ?) ELSE timeseries END', [currentDate, { date: currentDate, count: statistic.count ?? 1 }])
|
|
1607
1607
|
}).where({
|
|
1608
1608
|
name: statistic.name,
|
|
1609
1609
|
label: statistic.label,
|