fix: toast alert inconsistency (#2730)

This commit is contained in:
sabith-tu 2023-11-08 20:37:47 +05:30 committed by GitHub
parent 20fb79567f
commit 931f9d288a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -45,6 +45,11 @@ export const DeleteModuleModal: React.FC<Props> = observer((props) => {
.then(() => { .then(() => {
if (moduleId) router.push(`/${workspaceSlug}/projects/${data.project}/modules`); if (moduleId) router.push(`/${workspaceSlug}/projects/${data.project}/modules`);
handleClose(); handleClose();
setToastAlert({
type: "success",
title: "Success!",
message: "Module deleted successfully.",
});
}) })
.catch(() => { .catch(() => {
setToastAlert({ setToastAlert({

View File

@ -62,6 +62,11 @@ export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
if (projectId && projectId.toString() === project.id) router.push(`/${workspaceSlug}/projects`); if (projectId && projectId.toString() === project.id) router.push(`/${workspaceSlug}/projects`);
handleClose(); handleClose();
setToastAlert({
type: "success",
title: "Success!",
message: "Project deleted successfully.",
});
}) })
.catch(() => { .catch(() => {
setToastAlert({ setToastAlert({

View File

@ -32,7 +32,14 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
const createView = async (payload: IProjectView) => { const createView = async (payload: IProjectView) => {
await projectViewsStore await projectViewsStore
.createView(workspaceSlug, projectId, payload) .createView(workspaceSlug, projectId, payload)
.then(() => handleClose()) .then(() => {
handleClose();
setToastAlert({
type: "success",
title: "Success!",
message: "View created successfully.",
});
})
.catch(() => .catch(() =>
setToastAlert({ setToastAlert({
type: "error", type: "error",