From 34613426013b91b879f4a345425903d3c8746795 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Thu, 13 Apr 2023 22:52:41 -0700 Subject: [PATCH 1/2] Clean up api. --- pages/api/websites/[id]/pageviews.ts | 1 - pages/api/websites/[id]/stats.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/pages/api/websites/[id]/pageviews.ts b/pages/api/websites/[id]/pageviews.ts index 475c9ee1..c38b6c75 100644 --- a/pages/api/websites/[id]/pageviews.ts +++ b/pages/api/websites/[id]/pageviews.ts @@ -10,7 +10,6 @@ const unitTypes = ['year', 'month', 'hour', 'day']; export interface WebsitePageviewRequestQuery { id: string; - websiteId: string; startAt: number; endAt: number; unit: string; diff --git a/pages/api/websites/[id]/stats.ts b/pages/api/websites/[id]/stats.ts index b3ab2f07..f89ea5d1 100644 --- a/pages/api/websites/[id]/stats.ts +++ b/pages/api/websites/[id]/stats.ts @@ -7,7 +7,6 @@ import { getWebsiteStats } from 'queries'; export interface WebsiteStatsRequestQuery { id: string; - type: string; startAt: number; endAt: number; url: string; From 06649c2e314f34a050dc827ef95b5bc175b6249a Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Thu, 13 Apr 2023 22:59:04 -0700 Subject: [PATCH 2/2] at null check for subdivision save --- queries/analytics/session/createSession.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/analytics/session/createSession.ts b/queries/analytics/session/createSession.ts index 7286cb97..4014ac41 100644 --- a/queries/analytics/session/createSession.ts +++ b/queries/analytics/session/createSession.ts @@ -44,7 +44,7 @@ async function relationalQuery(data: Prisma.SessionCreateInput) { screen, language, country, - subdivision1: country.concat('-', subdivision1), + subdivision1: subdivision1 ? country.concat('-', subdivision1) : null, subdivision2, city, },