diff --git a/web/components/core/modals/existing-issues-list-modal.tsx b/web/components/core/modals/existing-issues-list-modal.tsx index c064b02be..3e3c2871c 100644 --- a/web/components/core/modals/existing-issues-list-modal.tsx +++ b/web/components/core/modals/existing-issues-list-modal.tsx @@ -66,12 +66,6 @@ export const ExistingIssuesListModal: React.FC = (props) => { await handleOnSubmit(selectedIssues).finally(() => setIsSubmitting(false)); handleClose(); - - setToast({ - type: TOAST_TYPE.SUCCESS, - title: "Success", - message: `Issue${selectedIssues.length > 1 ? "s" : ""} added successfully`, - }); }; useEffect(() => { diff --git a/web/components/issues/issue-layouts/empty-states/cycle.tsx b/web/components/issues/issue-layouts/empty-states/cycle.tsx index 7b86c16a5..7f8c318c7 100644 --- a/web/components/issues/issue-layouts/empty-states/cycle.tsx +++ b/web/components/issues/issue-layouts/empty-states/cycle.tsx @@ -59,13 +59,22 @@ export const CycleEmptyState: React.FC = observer((props) => { const issueIds = data.map((i) => i.id); - await issues.addIssueToCycle(workspaceSlug.toString(), projectId, cycleId.toString(), issueIds).catch(() => { - setToast({ - type: TOAST_TYPE.ERROR, - title: "Error!", - message: "Selected issues could not be added to the cycle. Please try again.", - }); - }); + await issues + .addIssueToCycle(workspaceSlug.toString(), projectId, cycleId.toString(), issueIds) + .then(() => + setToast({ + type: TOAST_TYPE.SUCCESS, + title: "Success!", + message: "Issues added to the cycle successfully.", + }) + ) + .catch(() => + setToast({ + type: TOAST_TYPE.ERROR, + title: "Error!", + message: "Selected issues could not be added to the cycle. Please try again.", + }) + ); }; const emptyStateDetail = CYCLE_EMPTY_STATE_DETAILS["no-issues"]; diff --git a/web/components/issues/issue-layouts/empty-states/module.tsx b/web/components/issues/issue-layouts/empty-states/module.tsx index c52d17af5..c17099335 100644 --- a/web/components/issues/issue-layouts/empty-states/module.tsx +++ b/web/components/issues/issue-layouts/empty-states/module.tsx @@ -59,6 +59,13 @@ export const ModuleEmptyState: React.FC = observer((props) => { const issueIds = data.map((i) => i.id); await issues .addIssuesToModule(workspaceSlug.toString(), projectId?.toString(), moduleId.toString(), issueIds) + .then(() => + setToast({ + type: TOAST_TYPE.SUCCESS, + title: "Success!", + message: "Issues added to the module successfully.", + }) + ) .catch(() => setToast({ type: TOAST_TYPE.ERROR, diff --git a/web/components/issues/issue-layouts/kanban/headers/group-by-card.tsx b/web/components/issues/issue-layouts/kanban/headers/group-by-card.tsx index 41dda4b21..b3cc24f28 100644 --- a/web/components/issues/issue-layouts/kanban/headers/group-by-card.tsx +++ b/web/components/issues/issue-layouts/kanban/headers/group-by-card.tsx @@ -65,7 +65,13 @@ export const HeaderGroupByCard: FC = observer((props) => { const issues = data.map((i) => i.id); try { - addIssuesToView && addIssuesToView(issues); + await addIssuesToView?.(issues); + + setToast({ + type: TOAST_TYPE.SUCCESS, + title: "Success!", + message: "Issues added to the cycle successfully.", + }); } catch (error) { setToast({ type: TOAST_TYPE.ERROR, diff --git a/web/components/issues/issue-layouts/list/headers/group-by-card.tsx b/web/components/issues/issue-layouts/list/headers/group-by-card.tsx index 7edf89bf1..acf26adb5 100644 --- a/web/components/issues/issue-layouts/list/headers/group-by-card.tsx +++ b/web/components/issues/issue-layouts/list/headers/group-by-card.tsx @@ -47,7 +47,13 @@ export const HeaderGroupByCard = observer( const issues = data.map((i) => i.id); try { - addIssuesToView && addIssuesToView(issues); + await addIssuesToView?.(issues); + + setToast({ + type: TOAST_TYPE.SUCCESS, + title: "Success!", + message: "Issues added to the cycle successfully.", + }); } catch (error) { setToast({ type: TOAST_TYPE.ERROR,