mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-11-26 12:22:20 +00:00
fix: added routing redirects with splat
This commit is contained in:
@@ -14,8 +14,11 @@ export const Route = createFileRoute("/_authenticate/_inject-org-details/organiz
|
||||
const remainingPath = params._splat || "";
|
||||
|
||||
throw redirect({
|
||||
to: `/organizations/$orgId/${remainingPath}` as const,
|
||||
params: { orgId },
|
||||
to: "/organizations/$orgId/$",
|
||||
params: {
|
||||
orgId,
|
||||
_splat: remainingPath ?? ""
|
||||
},
|
||||
search
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
import { localStorageService } from "@app/helpers/localStorage";
|
||||
|
||||
export const Route = createFileRoute("/_authenticate/_inject-org-details/projects/$")({
|
||||
beforeLoad: ({ context, params, search }) => {
|
||||
const orgId = context.organizationId;
|
||||
@@ -14,18 +12,10 @@ export const Route = createFileRoute("/_authenticate/_inject-org-details/project
|
||||
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
const remainingPath = params._splat || "";
|
||||
const projectId = localStorageService.getIintegrationProjectId();
|
||||
|
||||
if (!projectId) {
|
||||
throw redirect({
|
||||
to: "/organizations/$orgId/projects",
|
||||
params: { orgId }
|
||||
});
|
||||
}
|
||||
|
||||
throw redirect({
|
||||
to: `/organizations/$orgId/projects/${remainingPath}` as const,
|
||||
params: { orgId, projectId },
|
||||
to: "/organizations/$orgId/projects/$" as const,
|
||||
params: { orgId, _splat: remainingPath },
|
||||
search
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user