Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed reports fetch.

Mike Cao8a13e2c70a56
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 <SharePage shareId={shareId[0]} />;