mirror of
https://github.com/appwrite/console.git
synced 2026-04-07 19:17:46 +00:00
Merge pull request #1791 from appwrite/fix-build
fix: don't set endpoint during build
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
import { Billing } from '../sdk/billing';
|
||||
import { Backups } from '../sdk/backups';
|
||||
import { Sources } from '$lib/sdk/sources';
|
||||
import { building } from '$app/environment';
|
||||
|
||||
export function getApiEndpoint(): string {
|
||||
if (VARS.APPWRITE_ENDPOINT) return VARS.APPWRITE_ENDPOINT;
|
||||
@@ -33,10 +34,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,
|
||||
|
||||
+2
-4
@@ -2,16 +2,14 @@ import '@testing-library/jest-dom/vitest';
|
||||
import { beforeAll, vi } from 'vitest';
|
||||
|
||||
beforeAll(() => {
|
||||
vi.mock('$app/environment', () => ({
|
||||
browser: true
|
||||
}));
|
||||
vi.mock('$app/navigation', () => ({
|
||||
goto: vi.fn(),
|
||||
beforeNavigate: vi.fn()
|
||||
}));
|
||||
vi.mock('$app/environment', () => ({
|
||||
dev: true,
|
||||
browser: true
|
||||
browser: true,
|
||||
building: true
|
||||
}));
|
||||
vi.mock('$env/static/public', () => import.meta.env);
|
||||
vi.mock('$env/dynamic/public', () => ({
|
||||
|
||||
Reference in New Issue
Block a user