mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
* dev: change layout * chore: replace workspace slug and project id with anchor * chore: migration fixes * chore: update filtering logic * chore: endpoint changes * chore: update endpoint * chore: changed url pratterns * chore: use client side for layout and page * chore: issue vote changes * chore: project deploy board response change * refactor: publish project store and components * fix: update layout options after fetching settings * chore: remove unnecessary types * style: peek overview * refactor: components folder structure * fix: redirect from old path * chore: make the whole issue block clickable * chore: removed the migration file * chore: add server side redirection for old routes * chore: is enabled key change * chore: update types * chore: removed the migration file --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { notFound, redirect } from "next/navigation";
|
|
// services
|
|
import PublishService from "@/services/publish.service";
|
|
// types
|
|
import { TPublishSettings } from "@/types/publish";
|
|
|
|
const publishService = new PublishService();
|
|
|
|
type Props = {
|
|
params: {
|
|
workspaceSlug: string;
|
|
projectId: string;
|
|
};
|
|
searchParams: any;
|
|
};
|
|
|
|
export default async function IssuesPage(props: Props) {
|
|
const { params, searchParams } = props;
|
|
// query params
|
|
const { workspaceSlug, projectId } = params;
|
|
const { board, peekId } = searchParams;
|
|
|
|
let response: TPublishSettings | undefined = undefined;
|
|
try {
|
|
response = await publishService.fetchAnchorFromProjectDetails(workspaceSlug, projectId);
|
|
} catch (error) {
|
|
// redirect to 404 page on error
|
|
notFound();
|
|
}
|
|
|
|
let url = "";
|
|
if (response.entity_name === "project") {
|
|
url = `/issues/${response.anchor}`;
|
|
const params = new URLSearchParams();
|
|
if (board) params.append("board", board);
|
|
if (peekId) params.append("peekId", peekId);
|
|
if (params.toString()) url += `?${params.toString()}`;
|
|
redirect(url);
|
|
} else {
|
|
notFound();
|
|
}
|
|
}
|