This commit is contained in:
2023-06-26 18:57:41 +01:00
parent 45ecec24ac
commit f772cf0a68
2 changed files with 27 additions and 26 deletions
+20 -20
View File
@@ -73,6 +73,26 @@ function AddJob({ popUpHandler, categories }) {
}); // Holds state when submit button is pressed }); // Holds state when submit button is pressed
// FUNCTION TO GET Currency // FUNCTION TO GET Currency
const getUserCurrency = () => {
setCurrency((prev) => ({ ...prev, loading: true }));
ApiCall.getUserWallets()
.then((res) => {
if (res.data.internal_return < 0) {
setCurrency({ loading: false, status: true, data: [] });
return;
}
console.log("Res for currency >> ", res);
setCurrency({
loading: false,
status: true,
data: res.data.result_list,
});
})
.catch((err) => {
setCurrency({ loading: false, status: false, data: [] });
});
};
// FUNCTION TO HANDLE ADD JOB FORM // FUNCTION TO HANDLE ADD JOB FORM
const handleAddJob = (values, helpers) => { const handleAddJob = (values, helpers) => {
@@ -113,26 +133,6 @@ function AddJob({ popUpHandler, categories }) {
}; };
useEffect(() => { useEffect(() => {
const getUserCurrency = () => {
setCurrency((prev) => ({ ...prev, loading: true }));
ApiCall.getUserWallets()
.then((res) => {
if (res.data.internal_return < 0) {
setCurrency({ loading: false, status: true, data: [] });
return;
}
console.log("Res for currency >> ", res);
setCurrency({
loading: false,
status: true,
data: res.data.result_list,
});
})
.catch((err) => {
setCurrency({ loading: false, status: false, data: [] });
});
};
getUserCurrency(); getUserCurrency();
}, []); }, []);
+7 -6
View File
@@ -53,7 +53,7 @@ const EditJobPopOut = ({
let initialValues = { let initialValues = {
// initial values for formik // initial values for formik
country: country, currency: details.currency,
price: details?.price, price: details?.price,
title: details?.title, title: details?.title,
description: details?.description, description: details?.description,
@@ -74,7 +74,7 @@ const EditJobPopOut = ({
job_uid: details.job_uid, job_uid: details.job_uid,
...values, ...values,
}; };
delete reqData?.country; delete reqData?.currency;
try { try {
let res = await jobApi.jobManagerUpdateJob(reqData); let res = await jobApi.jobManagerUpdateJob(reqData);
let { data } = await res; let { data } = await res;
@@ -93,6 +93,7 @@ const EditJobPopOut = ({
[jobApi, navigate, onClose, details] [jobApi, navigate, onClose, details]
); );
console.log(details)
return ( return (
<ModalCom action={onClose} situation={situation} className="edit-popup"> <ModalCom action={onClose} situation={situation} className="edit-popup">
<div className="logout-modal-wrapper lg:w-[600px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl"> <div className="logout-modal-wrapper lg:w-[600px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
@@ -140,13 +141,13 @@ const EditJobPopOut = ({
<div className="field w-full mb-6 xl:mb-0"> <div className="field w-full mb-6 xl:mb-0">
<InputCom <InputCom
fieldClass="px-6 cursor-default" fieldClass="px-6 cursor-default"
label="Country" label="Currency"
labelClass="tracking-wide" labelClass="tracking-wide"
inputBg="bg-slate-100" inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple" inputClass="input-curve lg border border-light-purple"
type="text" type="text"
name="country" name="currency"
value={props.values.country} value={props.values.currency}
inputHandler={props.handleChange} inputHandler={props.handleChange}
blurHandler={props.handleBlur} blurHandler={props.handleBlur}
disable={true} disable={true}
@@ -163,7 +164,7 @@ const EditJobPopOut = ({
inputClass="input-curve lg border border-light-purple" inputClass="input-curve lg border border-light-purple"
type="number" type="number"
name="price" name="price"
value={props.values.price * 0.01} value={props.values.price}
inputHandler={props.handleChange} inputHandler={props.handleChange}
blurHandler={props.handleBlur} blurHandler={props.handleBlur}
errorBorder={ errorBorder={