mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: redirect from old path
This commit is contained in:
parent
83a1b0cf1f
commit
1e59b2789c
@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
params: {
|
||||
@ -6,7 +8,7 @@ type Props = {
|
||||
};
|
||||
};
|
||||
|
||||
const IssuesLayout = async (props: Props) => {
|
||||
const IssuesLayout = (props: Props) => {
|
||||
const { children } = props;
|
||||
|
||||
return <>{children}</>;
|
||||
|
@ -1,11 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { notFound, useSearchParams } from "next/navigation";
|
||||
import { notFound, useSearchParams, useRouter } from "next/navigation";
|
||||
// components
|
||||
import { LogoSpinner } from "@/components/common";
|
||||
// helpers
|
||||
import { navigate } from "@/helpers/actions";
|
||||
// services
|
||||
import PublishService from "@/services/publish.service";
|
||||
const publishService = new PublishService();
|
||||
@ -22,6 +20,8 @@ const IssuesPage = (props: Props) => {
|
||||
const { workspaceSlug, projectId } = params;
|
||||
// states
|
||||
const [error, setError] = useState(false);
|
||||
// router
|
||||
const router = useRouter();
|
||||
// params
|
||||
const searchParams = useSearchParams();
|
||||
const board = searchParams.get("board");
|
||||
@ -39,11 +39,12 @@ const IssuesPage = (props: Props) => {
|
||||
if (board) params.append("board", board);
|
||||
if (peekId) params.append("peekId", peekId);
|
||||
if (params.toString()) url += `?${params.toString()}`;
|
||||
navigate(url);
|
||||
router.push(url);
|
||||
// navigate(url);
|
||||
} else throw Error("Invalid entity name");
|
||||
})
|
||||
.catch(() => setError(true));
|
||||
}, [board, peekId, projectId, workspaceSlug]);
|
||||
}, [board, peekId, projectId, router, workspaceSlug]);
|
||||
|
||||
if (error) notFound();
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
"use server";
|
||||
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export const navigate = async (path: string) => redirect(path);
|
Loading…
Reference in New Issue
Block a user