mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Refactored startDate usage.
This commit is contained in:
parent
0f98fb5959
commit
a0aaeeeb57
9 changed files with 30 additions and 53 deletions
|
|
@ -1,9 +1,8 @@
|
|||
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 & { dataStartDate: Date }> {
|
||||
export async function loadWebsite(websiteId: string): Promise<Website> {
|
||||
let website;
|
||||
|
||||
if (cache.enabled) {
|
||||
|
|
@ -12,8 +11,6 @@ export async function loadWebsite(websiteId: string): Promise<Website & { dataSt
|
|||
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