chore: update endpoint

This commit is contained in:
Aaryan Khandelwal 2024-06-04 19:19:27 +05:30
parent 2d564a949e
commit 4718cb04a7
2 changed files with 4 additions and 7 deletions

View File

@ -30,9 +30,9 @@ const ProjectIssuesPage = (props: Props) => {
useEffect(() => { useEffect(() => {
if (!workspaceSlug || !projectId) return; if (!workspaceSlug || !projectId) return;
publishService publishService
.fetchAnchorFromOldDetails(workspaceSlug, projectId) .fetchAnchorFromProjectDetails(workspaceSlug, projectId)
.then((res) => { .then((res) => {
let url = `/${res.anchor}`; let url = `/issues/${res.anchor}`;
const params = new URLSearchParams(); const params = new URLSearchParams();
if (board) params.append("board", board); if (board) params.append("board", board);
if (peekId) params.append("peekId", peekId); if (peekId) params.append("peekId", peekId);

View File

@ -17,16 +17,13 @@ class PublishService extends APIService {
}); });
} }
async fetchAnchorFromOldDetails( async fetchAnchorFromProjectDetails(
workspaceSlug: string, workspaceSlug: string,
projectID: string projectID: string
): Promise<{ ): Promise<{
anchor: string; anchor: string;
}> { }> {
return this.post(`/api/public/publish-anchor/`, { return this.get(`/api/public/workspaces/${workspaceSlug}/projects/${projectID}/anchor/`)
workspaceSlug,
projectID,
})
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {
throw error?.response; throw error?.response;