Skip to content

Commit

Permalink
fix ABSOLUTE_ROUTES
Browse files Browse the repository at this point in the history
  • Loading branch information
leafty committed May 31, 2024
1 parent 93af391 commit f976198
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { NotebooksHelper } from "../../notebooks";
import { NotebookAnnotations } from "../../notebooks/components/session.types";
import { NOTIFICATION_TOPICS } from "../../notifications/Notifications.constants";
import { NotificationsManager } from "../../notifications/notifications.types";
import { ABSOLUTE_ROUTES } from "../../routing/routes.constants";
import AppContext from "../../utils/context/appContext";
import useLegacySelector from "../../utils/customHooks/useLegacySelector.hook";
import { toHumanDuration } from "../../utils/helpers/DurationUtils";
Expand Down Expand Up @@ -104,7 +105,7 @@ function AnonymousDeleteSessionModal({

const navigate = useNavigate();

const backUrl = generatePath("../../:namespace/:slug", {
const backUrl = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, {
namespace: namespace ?? "",
slug: slug ?? "",
});
Expand Down Expand Up @@ -224,7 +225,7 @@ function PauseSessionModalBody({

const navigate = useNavigate();

const backUrl = generatePath("../../:namespace/:slug", {
const backUrl = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, {
namespace: namespace ?? "",
slug: slug ?? "",
});
Expand Down Expand Up @@ -343,7 +344,7 @@ function DeleteSessionModalBody({

const navigate = useNavigate();

const backUrl = generatePath("../../:namespace/:slug", {
const backUrl = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, {
namespace: namespace ?? "",
slug: slug ?? "",
});
Expand Down
5 changes: 4 additions & 1 deletion client/src/features/sessionsV2/StartSessionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import cx from "classnames";
import { PlayFill } from "react-bootstrap-icons";
import { Link, generatePath } from "react-router-dom-v5-compat";

import { ABSOLUTE_ROUTES } from "../../routing/routes.constants";

interface StartSessionButtonProps {
namespace: string;
slug: string;
Expand All @@ -31,7 +34,7 @@ export default function StartSessionButton({
slug,
}: StartSessionButtonProps) {
const startUrl = generatePath(
"/v2/projects/:namespace/:slug/sessions/:launcherId/start",
ABSOLUTE_ROUTES.v2.projects.show.sessions.start,
{
launcherId,
namespace,
Expand Down

0 comments on commit f976198

Please sign in to comment.