diff --git a/apps/app/components/core/board-view/single-issue.tsx b/apps/app/components/core/board-view/single-issue.tsx index da98c468e..845a88196 100644 --- a/apps/app/components/core/board-view/single-issue.tsx +++ b/apps/app/components/core/board-view/single-issue.tsx @@ -174,8 +174,9 @@ export const SingleBoardIssue: React.FC = ({ mutate(MODULE_DETAILS(moduleId as string)); } else mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params)); setToastAlert({ - type: "info", - title: "Issue Updated Successfully", + type: "success", + title: "Success", + message: "Issue updated successfully.", }); }) .catch((error) => { diff --git a/apps/app/components/core/list-view/single-issue.tsx b/apps/app/components/core/list-view/single-issue.tsx index a4eec3004..1b5df61c0 100644 --- a/apps/app/components/core/list-view/single-issue.tsx +++ b/apps/app/components/core/list-view/single-issue.tsx @@ -150,8 +150,9 @@ export const SingleListIssue: React.FC = ({ mutate(MODULE_DETAILS(moduleId as string)); } else mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params)); setToastAlert({ - type: "info", - title: "Issue Updated Successfully", + type: "success", + title: "Success", + message: "Issue updated successfully.", }); }) .catch((error) => { diff --git a/apps/app/components/issues/modal.tsx b/apps/app/components/issues/modal.tsx index 883356d56..ead44d400 100644 --- a/apps/app/components/issues/modal.tsx +++ b/apps/app/components/issues/modal.tsx @@ -179,7 +179,7 @@ export const CreateUpdateIssueModal: React.FC = ({ setToastAlert({ type: "success", - title: "Success!", + title: "Success", message: "Issue updated successfully.", }); }) diff --git a/apps/app/components/issues/my-issues-list-item.tsx b/apps/app/components/issues/my-issues-list-item.tsx index 0fcb2bcfd..6f2679620 100644 --- a/apps/app/components/issues/my-issues-list-item.tsx +++ b/apps/app/components/issues/my-issues-list-item.tsx @@ -58,8 +58,9 @@ export const MyIssuesListItem: React.FC = ({ issue, properties, projectId .then((res) => { mutate(USER_ISSUE(workspaceSlug as string)); setToastAlert({ - type: "info", - title: "Issue Updated Successfully", + type: "success", + title: "Success", + message: "Issue updated successfully.", }); }) .catch((error) => { diff --git a/apps/app/components/issues/sidebar.tsx b/apps/app/components/issues/sidebar.tsx index 54cf69e1d..1d6f236c1 100644 --- a/apps/app/components/issues/sidebar.tsx +++ b/apps/app/components/issues/sidebar.tsx @@ -156,7 +156,14 @@ export const IssueDetailsSidebar: React.FC = ({ await issuesService .createIssueLink(workspaceSlug as string, projectId as string, issueDetail.id, payload) - .then(() => mutate(ISSUE_DETAILS(issueDetail.id))) + .then(() => { + mutate(ISSUE_DETAILS(issueDetail.id)); + setToastAlert({ + type: "success", + title: "Success", + message: "Link added successfully", + }); + }) .catch((err) => { if (err.status === 400) setToastAlert({ @@ -188,9 +195,19 @@ export const IssueDetailsSidebar: React.FC = ({ .deleteIssueLink(workspaceSlug as string, projectId as string, issueDetail.id, linkId) .then((res) => { mutate(ISSUE_DETAILS(issueDetail.id)); + setToastAlert({ + title: "Success", + message: "Link removed successfully", + type: "success", + }); }) .catch((err) => { console.log(err); + setToastAlert({ + type: "error", + title: "Error!", + message: "Something went wrong. Please try again.", + }); }); }; diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx index 85ea7551c..888a380d1 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx @@ -7,6 +7,8 @@ import useSWR, { mutate } from "swr"; // react-hook-form import { useForm } from "react-hook-form"; +// hooks +import useToast from "hooks/use-toast"; // services import issuesService from "services/issues.service"; // layouts @@ -50,6 +52,8 @@ const IssueDetailsPage: NextPage = () => { const router = useRouter(); const { workspaceSlug, projectId, issueId } = router.query; + const { setToastAlert } = useToast(); + const { data: issueDetails, mutate: mutateIssueDetails } = useSWR( workspaceSlug && projectId && issueId ? ISSUE_DETAILS(issueId as string) : null, workspaceSlug && projectId && issueId @@ -93,9 +97,19 @@ const IssueDetailsPage: NextPage = () => { .then((res) => { mutateIssueDetails(); mutate(PROJECT_ISSUES_ACTIVITY(issueId as string)); + setToastAlert({ + type: "success", + title: "Success", + message: "Issue updated successfully.", + }); }) .catch((e) => { console.error(e); + setToastAlert({ + type: "error", + title: "Error!", + message: "Something went wrong. Please try again.", + }); }); }, [workspaceSlug, issueId, projectId, mutateIssueDetails]