mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Use dataStartDate for resetDate.
This commit is contained in:
parent
ee8de858d1
commit
0f98fb5959
15 changed files with 172 additions and 85 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import cache from 'lib/cache';
|
||||
import { getWebsite, getSession, getUser } from 'queries';
|
||||
import { User, Website, Session } from '@prisma/client';
|
||||
import { DEFAULT_RESET_DATE } from './constants';
|
||||
|
||||
export async function loadWebsite(websiteId: string): Promise<Website> {
|
||||
export async function loadWebsite(websiteId: string): Promise<Website & { dataStartDate: Date }> {
|
||||
let website;
|
||||
|
||||
if (cache.enabled) {
|
||||
|
|
@ -11,6 +12,8 @@ export async function loadWebsite(websiteId: string): Promise<Website> {
|
|||
website = await getWebsite({ id: websiteId });
|
||||
}
|
||||
|
||||
website.dataStartDate = new Date(website?.resetAt || DEFAULT_RESET_DATE);
|
||||
|
||||
if (!website || website.deletedAt) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue