[WEB-658] fix: multiple toast alerts on adding existing issues (#3889)
* fix: enums export in the types package * chore: remove NestedKeyOf type * fix: multiple toast alerts on adding existing issues * chore: added success toast alerts
This commit is contained in:
parent
e4f48d6878
commit
c08d6987d0
5 changed files with 37 additions and 15 deletions
|
|
@ -59,13 +59,22 @@ export const CycleEmptyState: React.FC<Props> = 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"];
|
||||
|
|
|
|||
|
|
@ -59,6 +59,13 @@ export const ModuleEmptyState: React.FC<Props> = 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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue