mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge pull request #1773 from appwrite/fix-docker-build
Fix API endpoint prioritization order
This commit is contained in:
1 file changed
+5
-4
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user