Merge pull request #1773 from appwrite/fix-docker-build

Fix API endpoint prioritization order
This commit is contained in:
Torsten Dittmann authored and GitHub committed 2025-04-01 16:39:32 +02:00
commit e79b5dedb3
1 file changed
+5 -4
+5 -4
View File
@@ -29,7 +29,6 @@ import { Sources } from '$lib/sdk/sources';
import { building } from '$app/environment';
export function getApiEndpoint(): string {
if (building) return 'https://cloud.appwrite.io/v1';
if (VARS.APPWRITE_ENDPOINT) return VARS.APPWRITE_ENDPOINT;
return globalThis?.location?.origin + '/v1';
}
@@ -37,10 +36,12 @@ export function getApiEndpoint(): string {
const endpoint = getApiEndpoint();
const clientConsole = new Client();
clientConsole.setEndpoint(endpoint).setProject('console');
const clientProject = new Client();
clientProject.setEndpoint(endpoint).setMode('admin');
if (!building) {
clientConsole.setEndpoint(endpoint).setProject('console');
clientProject.setEndpoint(endpoint).setMode('admin');
}
const sdkForProject = {
client: clientProject,