diff --git a/src/routes/console/+layout.ts b/src/routes/console/+layout.ts index 65de11ecdd..1844097190 100644 --- a/src/routes/console/+layout.ts +++ b/src/routes/console/+layout.ts @@ -2,7 +2,12 @@ import { sdk } from '$lib/stores/sdk'; import type { LayoutLoad } from './$types'; export const load: LayoutLoad = async () => { - const response = await fetch(`${sdk.forConsole.client.config.endpoint}/health/version`); + const { endpoint, project } = sdk.forConsole.client.config; + const response = await fetch(`${endpoint}/health/version`, { + headers: { + 'X-Appwrite-Project': project + } + }); const data = await response.json(); return { diff --git a/src/routes/console/project-[project]/overview/platforms/wizard/store.ts b/src/routes/console/project-[project]/overview/platforms/wizard/store.ts index 8a00d0d351..f8e7b1b884 100644 --- a/src/routes/console/project-[project]/overview/platforms/wizard/store.ts +++ b/src/routes/console/project-[project]/overview/platforms/wizard/store.ts @@ -56,8 +56,12 @@ export const versions = cachedStore< >('versions', function ({ set }) { return { load: async () => { - const { endpoint } = sdk.forConsole.client.config; - const response = await fetch(`${endpoint}/../versions`); + const { endpoint, project } = sdk.forConsole.client.config; + const response = await fetch(`${endpoint}/../versions`, { + headers: { + 'X-Appwrite-Project': project + } + }); set(await response.json()); } }; diff --git a/src/routes/console/project-[project]/settings/+page.svelte b/src/routes/console/project-[project]/settings/+page.svelte index 699f12ddf8..be38f8bfcc 100644 --- a/src/routes/console/project-[project]/settings/+page.svelte +++ b/src/routes/console/project-[project]/settings/+page.svelte @@ -74,6 +74,7 @@ 'PATCH', new URL(sdk.forConsole.client.config.endpoint + path), { + 'X-Appwrite-Project': sdk.forConsole.client.config.project, 'content-type': 'application/json' }, { diff --git a/src/routes/console/project-[project]/settings/transferProject.svelte b/src/routes/console/project-[project]/settings/transferProject.svelte index 9e16d56117..cba255afd1 100644 --- a/src/routes/console/project-[project]/settings/transferProject.svelte +++ b/src/routes/console/project-[project]/settings/transferProject.svelte @@ -20,6 +20,7 @@ sdk.forConsole.client.config.endpoint + '/projects/' + $project.$id + '/team' ), { + 'X-Appwrite-Project': sdk.forConsole.client.config.project, 'content-type': 'application/json' }, { diff --git a/src/routes/register/invite/[slug]/+page.svelte b/src/routes/register/invite/[slug]/+page.svelte index 346f737c0f..c2d9deb611 100644 --- a/src/routes/register/invite/[slug]/+page.svelte +++ b/src/routes/register/invite/[slug]/+page.svelte @@ -54,9 +54,11 @@ async function invite() { try { - const res = await fetch(`${sdk.forConsole.client.config.endpoint}/account/invite`, { + const { endpoint, project } = sdk.forConsole.client.config; + const res = await fetch(`${endpoint}/account/invite`, { method: 'POST', headers: { + 'X-Appwrite-Project': project, 'Content-Type': 'application/json' }, body: JSON.stringify({