Compare commits

...

2 commits

Author SHA1 Message Date
Mike Cao
a8e3b5efbc Add rewrite for script in cloud mode.
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-08 16:01:47 -07:00
Mike Cao
8a13e2c70a Fixed reports fetch. 2025-10-08 15:56:38 -07:00
3 changed files with 10 additions and 3 deletions

View file

@ -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,

View file

@ -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();
}

View file

@ -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]} />;