change date type for req & design and fields & add requests & fix bug appointment and dashboard
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import ArrowLeftWhiteD from "@/components/icons/ArrowLeftWhiteD";
|
||||
import {
|
||||
convertJalaliTimestamp,
|
||||
handleTimeExpiresToken,
|
||||
removeAdditionalKeysDashboard,
|
||||
} from "@/helper";
|
||||
@@ -23,7 +24,23 @@ function ButtonSendData({
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const changeDateType = (data) => {
|
||||
const newData = data;
|
||||
const splitedDate = newData.birthday.split("/");
|
||||
newData.birthday = convertJalaliTimestamp(
|
||||
{
|
||||
jy: Number(splitedDate[0]),
|
||||
jm: Number(splitedDate[1]),
|
||||
jd: Number(splitedDate[2]),
|
||||
},
|
||||
true
|
||||
);
|
||||
return newData;
|
||||
};
|
||||
|
||||
const postData = () => {
|
||||
console.log(changeDateType(information));
|
||||
|
||||
request
|
||||
.postUserProfile(information)
|
||||
.then((response) => {
|
||||
@@ -67,6 +84,7 @@ function ButtonSendData({
|
||||
|
||||
const patchData = () => {
|
||||
const usedKays = removeAdditionalKeysDashboard(information);
|
||||
console.log(changeDateType(information));
|
||||
|
||||
request
|
||||
.patchUserProfile(
|
||||
|
||||
+4
-2
@@ -1,8 +1,8 @@
|
||||
import { getParsedUserInfo } from "@/helper";
|
||||
import Content from "./Content";
|
||||
import DateBirthday from "./DateBirthday";
|
||||
import AutoSelector from "./component/AutoSelector";
|
||||
import Field from "./component/Field";
|
||||
import AutoSelector from "../component/AutoSelector";
|
||||
import Field from "../component/Field";
|
||||
import {
|
||||
gender,
|
||||
blood_group,
|
||||
@@ -20,6 +20,8 @@ function Form({ insurance, errors, changeData, information }) {
|
||||
list.find((g) => g.id === information[name]);
|
||||
const parsedUserInfo = getParsedUserInfo();
|
||||
|
||||
console.log(information);
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-x-[24px] gap-y-[10px]">
|
||||
<Content title="شماره موبایل" isConfirmed={true}>
|
||||
-6
@@ -31,9 +31,3 @@ export const job = [
|
||||
{ label: "آزاد", id: "azad" },
|
||||
{ label: "دولتی", id: "dolati" },
|
||||
];
|
||||
|
||||
export const insurance = [
|
||||
{ label: "بیمه 1", id: 10 },
|
||||
{ label: "بیمه 2", id: 20 },
|
||||
{ label: "بیمه 3", id: 30 },
|
||||
];
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import Form from "./Form";
|
||||
import Form from "./form";
|
||||
import { request } from "@/services/response";
|
||||
import ButtonSendData from "./ButtonSendData";
|
||||
import { getParsedUserInfo } from "@/helper";
|
||||
import { disease } from "../information/disease";
|
||||
import { disease } from "./form/disease";
|
||||
|
||||
function Information({ information, setInformation }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user