From 8a13e2c70a566dc88b7abf111ec7a9af9dc2613f Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 8 Oct 2025 15:56:38 -0700 Subject: [PATCH 1/2] Fixed reports fetch. --- src/app/api/reports/route.ts | 4 ++-- src/app/share/[...shareId]/page.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/api/reports/route.ts b/src/app/api/reports/route.ts index 0f91d671a..ec8a4d239 100644 --- a/src/app/api/reports/route.ts +++ b/src/app/api/reports/route.ts @@ -8,7 +8,7 @@ import { getReports, createReport } from '@/queries/prisma'; export async function GET(request: Request) { const schema = z.object({ - websiteId: z.uuid().optional(), + websiteId: z.uuid(), type: z.string().optional(), ...pagingParams, }); @@ -26,7 +26,7 @@ export async function GET(request: Request) { search, }; - if (websiteId && !(await canViewWebsite(auth, websiteId))) { + if (!(await canViewWebsite(auth, websiteId))) { return unauthorized(); } diff --git a/src/app/share/[...shareId]/page.tsx b/src/app/share/[...shareId]/page.tsx index 3d3843160..b9900eb7c 100644 --- a/src/app/share/[...shareId]/page.tsx +++ b/src/app/share/[...shareId]/page.tsx @@ -1,6 +1,6 @@ import { SharePage } from './SharePage'; -export default async function ({ params }: { params: Promise<{ shareId: string }> }) { +export default async function ({ params }: { params: Promise<{ shareId: string[] }> }) { const { shareId } = await params; return ; From a8e3b5efbc004b1f046a446aaed3855c74926048 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 8 Oct 2025 16:01:47 -0700 Subject: [PATCH 2/2] Add rewrite for script in cloud mode. --- next.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/next.config.ts b/next.config.ts index e4fe228cf..b2b1c18da 100644 --- a/next.config.ts +++ b/next.config.ts @@ -155,6 +155,13 @@ if (trackerScriptName) { } } +if (cloudMode) { + rewrites.push({ + source: '/script.js', + destination: 'https://cloud.umami.is/script.js', + }); +} + /** @type {import('next').NextConfig} */ export default { reactStrictMode: false,