Skip to content

Commit 1a6dad0

Browse files
feat: dynamic invite to org link
1 parent 7f7d375 commit 1a6dad0

File tree

1 file changed

+13
-0
lines changed
  • src/routes/(console)/(redirects)/invite-to-org

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { redirect } from '@sveltejs/kit';
2+
import { base } from '$app/paths';
3+
import type { PageLoad } from './$types';
4+
5+
export const load: PageLoad = async ({ parent }) => {
6+
const { organizations, account } = await parent();
7+
8+
const teamId = account.prefs.organization ?? organizations.teams[0]?.$id;
9+
if (teamId) {
10+
redirect(303, `${base}/organization-${teamId}/members`);
11+
}
12+
redirect(303, base);
13+
};

0 commit comments

Comments
 (0)