Prepare Kalendartool for MPM and disable invites
This commit is contained in:
8
lib/client-fetch.ts
Normal file
8
lib/client-fetch.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/** Fetch wrapper for absolute app paths when Next.js basePath is enabled. */
|
||||
export function appFetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {
|
||||
if (typeof input !== 'string' || !input.startsWith('/') || input.startsWith('//')) {
|
||||
return fetch(input, init);
|
||||
}
|
||||
const basePath = process.env.NEXT_PUBLIC_APP_BASE_PATH ?? '';
|
||||
return fetch(`${basePath}${input}`, init);
|
||||
}
|
||||
Reference in New Issue
Block a user