This commit is contained in:
@@ -3,7 +3,7 @@ import { TickCircle } from "iconsax-react";
|
||||
import { useFormik } from "formik";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { toast } from "react-toastify";
|
||||
import { toast } from '../../../components/Toast';
|
||||
import * as Yup from "yup";
|
||||
import moment from "moment-jalaali";
|
||||
import Button from "../../../components/Button";
|
||||
@@ -48,11 +48,11 @@ const UpdateProject: FC = () => {
|
||||
{ id, params: values },
|
||||
{
|
||||
onSuccess: () => {
|
||||
toast.success(t("success"));
|
||||
toast(t("success"), 'success');
|
||||
navigate(`${Pages.taskmanager.projectList}${values.workspaceId}`);
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error.message[0]);
|
||||
toast(error.response?.data?.error.message[0], 'error');
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -75,7 +75,7 @@ const UpdateProject: FC = () => {
|
||||
}),
|
||||
onSubmit: async (values) => {
|
||||
if (!workspaceId) {
|
||||
toast.error(t("taskmanager.select_workspace"));
|
||||
toast(t("taskmanager.select_workspace"), 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ const UpdateProject: FC = () => {
|
||||
backgroundPicture = uploadResult?.data?.url ?? "";
|
||||
} catch (error) {
|
||||
const uploadError = error as ErrorType;
|
||||
toast.error(uploadError.response?.data?.error.message[0]);
|
||||
toast(uploadError.response?.data?.error.message[0], 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user