-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update sa toast mutation and change dashboard to route
- Loading branch information
1 parent
d55881c
commit b75a556
Showing
4 changed files
with
46 additions
and
73 deletions.
There are no files selected for viewing
51 changes: 0 additions & 51 deletions
51
src/app/(dynamic-pages)/(authenticated-pages)/dashboard/page.tsx
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/app/(dynamic-pages)/(authenticated-pages)/dashboard/route.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { getInitialOrganizationToRedirectTo } from '@/data/user/organizations'; | ||
import { toSiteURL } from '@/utils/helpers'; | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export async function GET(req: NextRequest) { | ||
try { | ||
const initialOrganization = await getInitialOrganizationToRedirectTo(); | ||
if (initialOrganization.status === 'error') { | ||
return NextResponse.redirect(toSiteURL('/500')); | ||
} | ||
return NextResponse.redirect(new URL(`/org/${initialOrganization.data}`, req.url)); | ||
} catch (error) { | ||
console.error('Failed to load dashboard:', error); | ||
// Redirect to an error page or show an error message | ||
return NextResponse.redirect(toSiteURL('/500')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters