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,4 +1,5 @@
|
||||
import Selector from "./fields/Selector";
|
||||
import ContentText from "@/app/component/ContentText";
|
||||
import EditField from "@/app/component/fields/EditField";
|
||||
import GroupedSelect from "@/app/component/selectors/GroupedSelect";
|
||||
import MultipleSelect from "@/app/component/selectors/MultipleSelect";
|
||||
@@ -6,7 +7,6 @@ import MultipleSelect from "@/app/component/selectors/MultipleSelect";
|
||||
// Data
|
||||
import specialties from "@/data/specialties.json";
|
||||
import education from "@/data/education.json";
|
||||
import ContentText from "@/app/component/ContentText";
|
||||
|
||||
const validate_medical_number = {
|
||||
min: 1,
|
||||
|
||||
@@ -51,8 +51,8 @@ function Form({ image, data, setData, resetData }) {
|
||||
<Fields
|
||||
data={data}
|
||||
services={services}
|
||||
changeData={changeData}
|
||||
updateNum={updateNum}
|
||||
changeData={changeData}
|
||||
/>
|
||||
<div className="flex flex-col gap-y-[24px]">
|
||||
<FieldDate changeListData={changeData} data={data?.time_work} />
|
||||
|
||||
@@ -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