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();
}, []);