fix: fix telemetry lost timezone problem

This commit is contained in:
moonrailgun 2024-03-07 02:18:15 +08:00
parent ceef5c4b71
commit 40e1bac541

View File

@ -158,7 +158,16 @@ export const telemetryRouter = router({
) )
.output(z.object({ pageviews: z.any(), sessions: z.any() })) .output(z.object({ pageviews: z.any(), sessions: z.any() }))
.query(async ({ input }) => { .query(async ({ input }) => {
const { telemetryId, startAt, endAt, url, country, region, city } = input; const {
telemetryId,
startAt,
endAt,
timezone,
url,
country,
region,
city,
} = input;
const startDate = new Date(startAt); const startDate = new Date(startAt);
const endDate = new Date(endAt); const endDate = new Date(endAt);
@ -174,6 +183,7 @@ export const telemetryRouter = router({
startDate, startDate,
endDate, endDate,
unit: input.unit, unit: input.unit,
timezone,
url, url,
country, country,
region, region,
@ -216,8 +226,17 @@ export const telemetryRouter = router({
) )
) )
.query(async ({ input }) => { .query(async ({ input }) => {
const { telemetryId, type, startAt, endAt, url, country, region, city } = const {
input; telemetryId,
type,
startAt,
endAt,
timezone,
url,
country,
region,
city,
} = input;
const startDate = new Date(startAt); const startDate = new Date(startAt);
const endDate = new Date(endAt); const endDate = new Date(endAt);
@ -231,6 +250,7 @@ export const telemetryRouter = router({
const filters = { const filters = {
startDate, startDate,
endDate, endDate,
timezone,
url, url,
country, country,
region, region,