fix resetAt logic
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run

This commit is contained in:
Francis Cao 2025-10-07 09:44:59 -07:00
parent 36ae53654d
commit d948e122ea

View file

@ -1,6 +1,6 @@
import { checkAuth } from '@/lib/auth';
import { DEFAULT_PAGE_SIZE, FILTER_COLUMNS } from '@/lib/constants';
import { getAllowedUnits, getMinimumUnit, parseDateRange } from '@/lib/date';
import { getAllowedUnits, getMinimumUnit, maxDate, parseDateRange } from '@/lib/date';
import { fetchWebsite } from '@/lib/load';
import { filtersArrayToObject } from '@/lib/params';
import { badRequest, unauthorized } from '@/lib/response';
@ -84,7 +84,7 @@ export async function setWebsiteDate(websiteId: string, data: Record<string, any
const website = await fetchWebsite(websiteId);
if (website?.resetAt) {
data.startDate = new Date(website.resetAt);
data.startDate = maxDate(data.startDate, new Date(website?.resetAt));
}
return data;