Skip to content

Commit

Permalink
Merge pull request #1375 from appwrite/feat-invite-to-org-redirect
Browse files Browse the repository at this point in the history
feat: dynamic invite to org link
  • Loading branch information
TorstenDittmann authored Sep 25, 2024
2 parents 7f7d375 + ac73471 commit 5993684
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/routes/(console)/(redirects)/members/+page.ts
Original file line number Diff line number Diff line change
@@ -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);
};

0 comments on commit 5993684

Please sign in to comment.