mirror of
https://github.com/appwrite/console.git
synced 2026-04-07 19:17:46 +00:00
address comments; remove: unused api calls!!!
This commit is contained in:
@@ -9,8 +9,9 @@
|
||||
import { openMigrationWizard } from '../(migration-wizard)';
|
||||
import { base } from '$app/paths';
|
||||
import { isOwner } from '$lib/stores/roles';
|
||||
import type { PageData } from './$types';
|
||||
|
||||
export let data;
|
||||
export let data: PageData;
|
||||
|
||||
$: if ($requestedMigration) {
|
||||
openMigrationWizard();
|
||||
|
||||
@@ -12,19 +12,16 @@ import { headerAlert } from '$lib/stores/headerAlert';
|
||||
import PaymentFailed from '$lib/components/billing/alerts/paymentFailed.svelte';
|
||||
import { loadAvailableRegions } from '$routes/(console)/regions';
|
||||
import { roles as rolesStore, scopes as scopesStore } from '$lib/stores/roles';
|
||||
import { organization as orgStore, type Organization } from '$lib/stores/organization';
|
||||
import { type Organization } from '$lib/stores/organization';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.PROJECT);
|
||||
let currentPlan: Plan = null;
|
||||
const orgFromStore: Organization = get(orgStore);
|
||||
|
||||
try {
|
||||
const project = await sdk.forConsole.projects.get(params.project);
|
||||
const [organization, prefs, regionalConsoleVariables, _] = await Promise.all([
|
||||
orgFromStore
|
||||
? (Promise.resolve(orgFromStore) as Promise<Organization>)
|
||||
: (sdk.forConsole.teams.get(project.teamId) as Promise<Organization>),
|
||||
sdk.forConsole.teams.get(project.teamId) as Promise<Organization>,
|
||||
sdk.forConsole.account.getPrefs(),
|
||||
sdk.forConsoleIn(project.region).console.variables(),
|
||||
loadAvailableRegions(project.teamId)
|
||||
|
||||
@@ -4,7 +4,9 @@ import type { PageLoad } from './$types';
|
||||
import { hasOnboardingDismissed } from '$lib/helpers/onboarding';
|
||||
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const path = !hasOnboardingDismissed(params.project) ? 'get-started' : 'overview/platforms';
|
||||
if (hasOnboardingDismissed(params.project)) {
|
||||
redirect(302, `${base}/project-${params.region}-${params.project}/overview`);
|
||||
}
|
||||
|
||||
redirect(302, `${base}/project-${params.region}-${params.project}/${path}`);
|
||||
redirect(302, `${base}/project-${params.region}-${params.project}/get-started`);
|
||||
};
|
||||
|
||||
@@ -12,13 +12,9 @@ export const load: PageLoad = async ({ url, depends, params }) => {
|
||||
runtimes: url.searchParams.getAll('runtime')
|
||||
};
|
||||
|
||||
const localSdkInstance = sdk.forProject(params.region, params.project);
|
||||
|
||||
const { templates: allTemplates } = await localSdkInstance.functions.listTemplates(
|
||||
undefined,
|
||||
undefined,
|
||||
100
|
||||
);
|
||||
const { templates: allTemplates } = await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.functions.listTemplates(undefined, undefined, 100);
|
||||
|
||||
const runtimes = new Set<string>();
|
||||
const useCases = new Set<string>();
|
||||
@@ -51,7 +47,6 @@ export const load: PageLoad = async ({ url, depends, params }) => {
|
||||
runtimes,
|
||||
useCases,
|
||||
search,
|
||||
templates,
|
||||
functions: await localSdkInstance.functions.list()
|
||||
templates
|
||||
};
|
||||
};
|
||||
|
||||
+1
-2
@@ -8,7 +8,6 @@ export const load: PageLoad = async ({ params, depends }) => {
|
||||
return {
|
||||
template: await sdk
|
||||
.forProject(params.region, params.project)
|
||||
.functions.getTemplate(params.template),
|
||||
functions: await sdk.forProject(params.region, params.project).functions.list()
|
||||
.functions.getTemplate(params.template)
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user