fix export api

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-08-28 21:58:08 +02:00
parent 478943a90b
commit 1f3b56cdbb
2 changed files with 9 additions and 3 deletions

View File

@@ -361,7 +361,7 @@ export async function getEventList({
}
if (startDate && endDate) {
sb.where.created_at = `toDate(created_at) BETWEEN '${formatClickhouseDate(startDate)}' AND '${formatClickhouseDate(endDate)}'`;
sb.where.created_at = `toDate(created_at) BETWEEN toDate('${formatClickhouseDate(startDate)}') AND toDate('${formatClickhouseDate(endDate)}')`;
}
if (events && events.length > 0) {
@@ -403,7 +403,7 @@ export async function getEventsCount({
}
if (startDate && endDate) {
sb.where.created_at = `created_at BETWEEN '${formatClickhouseDate(startDate)}' AND '${formatClickhouseDate(endDate)}'`;
sb.where.created_at = `toDate(created_at) BETWEEN toDate('${formatClickhouseDate(startDate)}') AND toDate('${formatClickhouseDate(endDate)}')`;
}
if (events && events.length > 0) {