change name office-info && change name img uploaded && change theme selector && set default tab in appo page && clean code
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import ArrowLeftPA from "@/components/icons/ArrowLeftPA";
|
||||
import { checkAllValues } from "@/helper";
|
||||
import { alert, checkAllValues } from "@/helper";
|
||||
import { request } from "@/services/response";
|
||||
import { Button } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { transformData } from "./function";
|
||||
import { toast, ToastContainer } from "react-toastify";
|
||||
|
||||
function SendReq({ img, data, resetData }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -17,12 +18,16 @@ function SendReq({ img, data, resetData }) {
|
||||
|
||||
request
|
||||
.postDoctor(transformed)
|
||||
.then(() => {
|
||||
resetData();
|
||||
setLoading(false);
|
||||
.then((res) => {
|
||||
if (res.id) {
|
||||
alert("success", "پزشک جدید با موفقیت اضافه شد!");
|
||||
resetData();
|
||||
setLoading(false);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setLoading(false);
|
||||
alert("error", "خطا در ثبت پزشک! لطفاً دوباره تلاش کنید.");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user