From bd4b6b6f05cae259b22ec27cd4afab8d235dfeba Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 1 Apr 2025 11:21:00 +0200 Subject: [PATCH] fix: templates --- src/routes/(public)/template-[template]/+page.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/routes/(public)/template-[template]/+page.ts b/src/routes/(public)/template-[template]/+page.ts index b2a11b4af..7ea2afe98 100644 --- a/src/routes/(public)/template-[template]/+page.ts +++ b/src/routes/(public)/template-[template]/+page.ts @@ -1,13 +1,12 @@ import { BillingPlan } from '$lib/constants.js'; import { sdk } from '$lib/stores/sdk.js'; import { ID, type Models } from '@appwrite.io/console'; -// import { isCloud } from '$lib/system.js'; -// import { redirect } from '@sveltejs/kit'; +import { isCloud } from '$lib/system.js'; +import { redirect } from '@sveltejs/kit'; import { error } from '@sveltejs/kit'; export const load = async ({ parent, url, params }) => { - //TODO: enable before release - // if (!isCloud) redirect(303, '/'); + if (!isCloud) redirect(303, '/'); const { account } = await parent(); @@ -28,8 +27,10 @@ export const load = async ({ parent, url, params }) => { default: error(404, 'Type is not valid'); } - // const organizations = account?.$id ? await sdk.forConsole.billing.listOrganization() : undefined; - const organizations = account?.$id ? await sdk.forConsole.teams.list() : undefined; + const organizations = account?.$id + ? await sdk.forConsole.billing.listOrganization() + : undefined; + // const organizations = account?.$id ? await sdk.forConsole.teams.list() : undefined; if (!organizations?.total && account?.$id) { await sdk.forConsole.billing.createOrganization(