feat: dynamic invite to org link

This commit is contained in:
Torsten Dittmann committed 2024-09-25 16:27:21 +02:00
1 parent 7f7d375f50
commit 1a6dad033b
1 file changed
+13
@@ -0,0 +1,13 @@
import { redirect } from '@sveltejs/kit';
import { base } from '$app/paths';
import type { PageLoad } from './$types';
export const load: PageLoad = async ({ parent }) => {
const { organizations, account } = await parent();
const teamId = account.prefs.organization ?? organizations.teams[0]?.$id;
if (teamId) {
redirect(303, `${base}/organization-${teamId}/members`);
}
redirect(303, base);
};