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
// 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
const handleAddJob = (values, helpers) => {
@@ -113,26 +133,6 @@ function AddJob({ popUpHandler, categories }) {
};
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();
}, []);
+7 -6
View File
@@ -53,7 +53,7 @@ const EditJobPopOut = ({
let initialValues = {
// initial values for formik
country: country,
currency: details.currency,
price: details?.price,
title: details?.title,
description: details?.description,
@@ -74,7 +74,7 @@ const EditJobPopOut = ({
job_uid: details.job_uid,
...values,
};
delete reqData?.country;
delete reqData?.currency;
try {
let res = await jobApi.jobManagerUpdateJob(reqData);
let { data } = await res;
@@ -93,6 +93,7 @@ const EditJobPopOut = ({
[jobApi, navigate, onClose, details]
);
console.log(details)
return (
<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">
@@ -140,13 +141,13 @@ const EditJobPopOut = ({
<div className="field w-full mb-6 xl:mb-0">
<InputCom
fieldClass="px-6 cursor-default"
label="Country"
label="Currency"
labelClass="tracking-wide"
inputBg="bg-slate-100"
inputClass="input-curve lg border border-light-purple"
type="text"
name="country"
value={props.values.country}
name="currency"
value={props.values.currency}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
disable={true}
@@ -163,7 +164,7 @@ const EditJobPopOut = ({
inputClass="input-curve lg border border-light-purple"
type="number"
name="price"
value={props.values.price * 0.01}
value={props.values.price}
inputHandler={props.handleChange}
blurHandler={props.handleBlur}
errorBorder={