-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(route): add alternative route for /tree
Close #766
- Loading branch information
1 parent
b92fe3d
commit 694e806
Showing
10 changed files
with
351 additions
and
0 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
dashboard/src/routes/(alternatives)/t/$treeId/build/$buildId/index.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,17 @@ | ||
import { createFileRoute, redirect } from '@tanstack/react-router'; | ||
|
||
import { RedirectFrom } from '@/types/general'; | ||
|
||
export const Route = createFileRoute( | ||
'/(alternatives)/t/$treeId/build/$buildId/', | ||
)({ | ||
loaderDeps: ({ search }) => ({ search }), | ||
loader: async ({ params, deps }) => { | ||
throw redirect({ | ||
to: '/build/$buildId', | ||
params: { buildId: params.buildId }, | ||
search: deps.search, | ||
state: { id: params.treeId, from: RedirectFrom.Tree }, | ||
}); | ||
}, | ||
}); |
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,12 @@ | ||
import { createFileRoute, redirect } from '@tanstack/react-router'; | ||
|
||
export const Route = createFileRoute('/(alternatives)/t/$treeId/')({ | ||
loaderDeps: ({ search }) => ({ search }), | ||
loader: ({ deps, params }) => { | ||
throw redirect({ | ||
to: '/tree/$treeId', | ||
search: deps.search, | ||
params, | ||
}); | ||
}, | ||
}); |
Oops, something went wrong.