forked from github/plane
fix: toast alert content
This commit is contained in:
parent
66bc3df480
commit
d87e149f72
@ -105,12 +105,6 @@ export const ExistingIssuesListModal: React.FC<Props> = ({
|
||||
}
|
||||
|
||||
handleClose();
|
||||
|
||||
setToastAlert({
|
||||
title: "Success",
|
||||
type: "success",
|
||||
message: `Issue${selectedIssues.length > 1 ? "s" : ""} added successfully`,
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -9,6 +9,8 @@ import useSWR, { mutate } from "swr";
|
||||
import { Disclosure, Transition } from "@headlessui/react";
|
||||
// services
|
||||
import issuesService from "services/issues.service";
|
||||
// hooks
|
||||
import useToast from "hooks/use-toast";
|
||||
// contexts
|
||||
import { useProjectMyMembership } from "contexts/project-member.context";
|
||||
// components
|
||||
@ -38,6 +40,8 @@ export const SubIssuesList: FC<Props> = ({ parentIssue, user, disabled = false }
|
||||
const router = useRouter();
|
||||
const { workspaceSlug } = router.query;
|
||||
|
||||
const { setToastAlert } = useToast();
|
||||
|
||||
const { memberRole } = useProjectMyMembership();
|
||||
|
||||
const { data: subIssuesResponse } = useSWR(
|
||||
@ -56,6 +60,13 @@ export const SubIssuesList: FC<Props> = ({ parentIssue, user, disabled = false }
|
||||
|
||||
await issuesService
|
||||
.addSubIssues(workspaceSlug as string, parentIssue.project, parentIssue.id, payload)
|
||||
.then(() =>
|
||||
setToastAlert({
|
||||
title: "Success",
|
||||
type: "success",
|
||||
message: "Issues added successfully",
|
||||
})
|
||||
)
|
||||
.finally(() => mutate(SUB_ISSUES(parentIssue.id)));
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user