More resetDate conversion.

This commit is contained in:
Mike Cao 2023-04-19 21:16:56 -07:00
parent e63591e35d
commit 03ba225587
6 changed files with 11 additions and 11 deletions

View File

@ -47,7 +47,7 @@ async function relationalQuery(
) {
const { toUuid, rawQuery, getDateQuery, getFilterQuery } = prisma;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params: any = [websiteId, resetDate, startDate, endDate];
const filterQuery = getFilterQuery(filters, params);
@ -89,7 +89,7 @@ async function clickhouseQuery(
) {
const { rawQuery, getDateQuery, getDateFormat, getBetweenDates, getFilterQuery } = clickhouse;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params = { websiteId };
return rawQuery(

View File

@ -49,7 +49,7 @@ async function relationalQuery(
const { startDate, endDate, timeSeries, eventName, urlPath, filters } = data;
const { toUuid, rawQuery, getEventDataFilterQuery, getDateQuery } = prisma;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params: any = [websiteId, resetDate, startDate, endDate, eventName || ''];
return rawQuery(
@ -99,7 +99,7 @@ async function clickhouseQuery(
const { rawQuery, getDateFormat, getBetweenDates, getDateQuery, getEventDataFilterQuery } =
clickhouse;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params = { websiteId };
return rawQuery(

View File

@ -33,7 +33,7 @@ async function relationalQuery(
const { startDate, endDate, filters = {}, column } = criteria;
const { rawQuery, parseFilters, toUuid } = prisma;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params: any = [
websiteId,
resetDate,
@ -80,7 +80,7 @@ async function clickhouseQuery(
const { startDate, endDate, filters = {}, column } = criteria;
const { rawQuery, getDateFormat, parseFilters, getBetweenDates } = clickhouse;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params = {
websiteId,
eventType: column === 'event_name' ? EVENT_TYPE.customEvent : EVENT_TYPE.pageView,

View File

@ -47,7 +47,7 @@ async function relationalQuery(
} = criteria;
const { toUuid, getDateQuery, parseFilters, rawQuery } = prisma;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params: any = [websiteId, resetDate, startDate, endDate];
const { filterQuery, joinSession } = parseFilters(filters, params);
@ -95,7 +95,7 @@ async function clickhouseQuery(
getBetweenDates,
} = clickhouse;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params = { websiteId };
const { filterQuery } = parseFilters(filters, params);

View File

@ -21,7 +21,7 @@ async function relationalQuery(
criteria: { startDate: Date; endDate: Date; column: string; filters: object },
) {
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const { startDate, endDate, column, filters = {} } = criteria;
const { toUuid, parseFilters, rawQuery } = prisma;
const params: any = [websiteId, resetDate, startDate, endDate];
@ -55,7 +55,7 @@ async function clickhouseQuery(
const { startDate, endDate, column, filters = {} } = data;
const { getDateFormat, parseFilters, getBetweenDates, rawQuery } = clickhouse;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params = { websiteId };
const { filterQuery } = parseFilters(filters, params);

View File

@ -59,7 +59,7 @@ async function clickhouseQuery(
const { startDate, endDate, filters = {} } = criteria;
const { rawQuery, getDateFormat, getDateQuery, getBetweenDates, parseFilters } = clickhouse;
const website = await loadWebsite(websiteId);
const resetDate = website?.resetAt || website?.createdAt;
const resetDate = new Date(website?.resetAt || website?.createdAt);
const params = { websiteId };
const { filterQuery } = parseFilters(filters, params);