Merge branch 'faq-display' of WrenchBoard/Users-Wrench into master
This commit is contained in:
@@ -14,8 +14,14 @@ const validationSchema = Yup.object().shape({
|
||||
.max(25, "Maximum 25 characters")
|
||||
.required("Country is required"),
|
||||
price: Yup.number()
|
||||
.typeError("you must specify a number")
|
||||
.typeError("Invalid number")
|
||||
.min(1, "Price must be greater than 0")
|
||||
.test("no-e", "Invalid number", (value) => {
|
||||
if (value && /\d+e/.test(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.required("Price is required"),
|
||||
title: Yup.string()
|
||||
.min(3, "Minimum 3 characters")
|
||||
@@ -42,15 +48,16 @@ function AddJob({ popUpHandler, categories }) {
|
||||
|
||||
let { userDetails } = useSelector((state) => state.userDetails);
|
||||
|
||||
let [country, setCountry] = useState({
|
||||
const [numberValue, setNumberValue] = useState("");
|
||||
let [currency, setCurrency] = useState({
|
||||
loading: true,
|
||||
status: false,
|
||||
data: [],
|
||||
}); // To Hold the array of country getUserCountry returns
|
||||
data: null,
|
||||
}); // To Hold the array of currency getUserCurrency returns
|
||||
|
||||
let initialValues = {
|
||||
// initial values for formik
|
||||
country: userDetails.country,
|
||||
currency: "",
|
||||
price: "",
|
||||
title: "",
|
||||
description: "",
|
||||
@@ -65,23 +72,25 @@ function AddJob({ popUpHandler, categories }) {
|
||||
message: "",
|
||||
}); // Holds state when submit button is pressed
|
||||
|
||||
// FUNCTION TO GET COUNTRY
|
||||
const getUserCountry = () => {
|
||||
setCountry((prev) => ({ ...prev, loading: true }));
|
||||
ApiCall.getSignupCountryData()
|
||||
// FUNCTION TO GET Currency
|
||||
const getUserCurrency = () => {
|
||||
setCurrency((prev) => ({ ...prev, loading: true }));
|
||||
ApiCall.getUserWallets()
|
||||
.then((res) => {
|
||||
if (res.data.internal_return < 1) {
|
||||
setCountry({ loading: false, status: true, data: [] });
|
||||
if (res.data.internal_return < 0) {
|
||||
setCurrency({ loading: false, status: true, data: [] });
|
||||
return;
|
||||
}
|
||||
setCountry({
|
||||
console.log("Res for currency >> ", res);
|
||||
|
||||
setCurrency({
|
||||
loading: false,
|
||||
status: true,
|
||||
data: res.data.signup_country,
|
||||
data: res.data.result_list,
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
setCountry({ loading: false, status: false, data: [] });
|
||||
setCurrency({ loading: false, status: false, data: [] });
|
||||
});
|
||||
};
|
||||
|
||||
@@ -113,7 +122,7 @@ function AddJob({ popUpHandler, categories }) {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Opps! soemthing went wrong. Try Again",
|
||||
message: "Opps! something went wrong. Try Again",
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -124,9 +133,11 @@ function AddJob({ popUpHandler, categories }) {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getUserCountry();
|
||||
getUserCurrency();
|
||||
}, []);
|
||||
|
||||
console.log("Currency >> ", currency.data);
|
||||
|
||||
return (
|
||||
<div className="add-job p-5 w-full bg-white rounded-md flex flex-col justify-between">
|
||||
<Formik
|
||||
@@ -140,46 +151,40 @@ function AddJob({ popUpHandler, categories }) {
|
||||
<div className="flex flex-col-reverse sm:flex-row">
|
||||
<div className="fields w-full">
|
||||
{/* inputs starts here */}
|
||||
{/* country */}
|
||||
<div className="xl:flex xl:space-x-7 mb-[5px]">
|
||||
<div className="field w-full mb-6 xl:mb-0">
|
||||
<label
|
||||
htmlFor="country"
|
||||
htmlFor="currency"
|
||||
className="input-label text-[#181c32] dark:text-white text-[13.975px] leading-[20.9625px] font-semibold block"
|
||||
>
|
||||
Country
|
||||
Currency
|
||||
</label>
|
||||
<select
|
||||
id="country"
|
||||
name="country"
|
||||
disabled
|
||||
value={props.values.country}
|
||||
id="currency"
|
||||
name="currency"
|
||||
value={props.values.currency}
|
||||
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
|
||||
onChange={props.handleChange}
|
||||
onBlur={props.handleBlur}
|
||||
>
|
||||
{country.loading ? (
|
||||
{currency.loading ? (
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Loading...
|
||||
</option>
|
||||
) : country.data.length ? (
|
||||
) : currency.data.length ? (
|
||||
<>
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
Select...
|
||||
Select a currency
|
||||
</option>
|
||||
{country.data.map((item, index) => {
|
||||
if (item[0] == userDetails.country) {
|
||||
return (
|
||||
<option
|
||||
key={index}
|
||||
className="text-slate-500 text-lg"
|
||||
value={item[0]}
|
||||
>
|
||||
{item[1]}
|
||||
</option>
|
||||
);
|
||||
}
|
||||
})}
|
||||
{currency.data?.map((item, index) => (
|
||||
<option
|
||||
key={index}
|
||||
className="text-slate-500 text-lg"
|
||||
value={item?.country}
|
||||
>
|
||||
{item?.description}
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
) : (
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, {useEffect, useState} from "react";
|
||||
import React, { useState} from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { toast } from "react-toastify";
|
||||
import useToggle from "../../hooks/useToggle";
|
||||
import { drawerToggle } from "../../store/drawer";
|
||||
import ModalCom from "../Helpers/ModalCom";
|
||||
|
||||
@@ -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={
|
||||
|
||||
@@ -47,9 +47,9 @@ class usersService {
|
||||
};
|
||||
return this.postAuxEnd("/mybanklist", postData);
|
||||
}
|
||||
getUserWallets(reqData) {
|
||||
getUserWallets() {
|
||||
var postData = {
|
||||
uuid: localStorage.getItem("uuid"),
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
};
|
||||
@@ -208,7 +208,7 @@ class usersService {
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 22025,
|
||||
...reqData
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/familymanage", postData);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ class usersService {
|
||||
limit: 30,
|
||||
offset: 0,
|
||||
action: 13008,
|
||||
...reqData
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/jobmanageractive", postData);
|
||||
}
|
||||
@@ -472,8 +472,8 @@ class usersService {
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 11032,
|
||||
...postData
|
||||
}
|
||||
...postData,
|
||||
};
|
||||
return this.postAuxEnd("/sendreferral", reqData);
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ class usersService {
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 85020,
|
||||
...reqData
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/couponredeem", postData);
|
||||
}
|
||||
@@ -508,7 +508,7 @@ class usersService {
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 11183,
|
||||
country: "NG",
|
||||
// country: "NG",
|
||||
};
|
||||
return this.postAuxEnd("/countrybanks", postData);
|
||||
}
|
||||
@@ -530,9 +530,9 @@ class usersService {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
msg_type: 'JOB',
|
||||
msg_type: "JOB",
|
||||
action: 13033,
|
||||
...reqData
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/marketinterest", postData);
|
||||
}
|
||||
@@ -542,9 +542,9 @@ class usersService {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
msg_type: 'JOB',
|
||||
msg_type: "JOB",
|
||||
action: 13036,
|
||||
...reqData
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/marketmessage", postData);
|
||||
}
|
||||
@@ -646,7 +646,7 @@ class usersService {
|
||||
for (let data in postData) {
|
||||
formData.append(data, postData[data]);
|
||||
}
|
||||
// return this.postAuxEnd("/uploads", formData);
|
||||
// return this.postAuxEnd("/uploads", formData);
|
||||
|
||||
return this.postAuxEnd("/uploads", postData);
|
||||
}
|
||||
@@ -691,25 +691,25 @@ class usersService {
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 13024,
|
||||
limit: 30,
|
||||
offset: 0
|
||||
offset: 0,
|
||||
};
|
||||
return this.postAuxEnd("/offersinterestlist", postData);
|
||||
}
|
||||
|
||||
// END POINT FOR PROCESSING OFFER INTEREST
|
||||
offersInterestProc(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 13034,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/offersinterestproc", postData);
|
||||
}
|
||||
// END POINT FOR PROCESSING OFFER INTEREST
|
||||
offersInterestProc(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 13034,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/offersinterestproc", postData);
|
||||
}
|
||||
|
||||
// END POINT FOR WORKER TO MARK TASK AS COMPLETED
|
||||
workerJobAction(reqData) {
|
||||
// END POINT FOR WORKER TO MARK TASK AS COMPLETED
|
||||
workerJobAction(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
@@ -720,17 +720,17 @@ class usersService {
|
||||
return this.postAuxEnd("/activetaskstatus", postData);
|
||||
}
|
||||
|
||||
// END POINT FOR OWNER JOB ACTION
|
||||
ownerJobAction(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 14015,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/activejobstatus", postData);
|
||||
}
|
||||
// END POINT FOR OWNER JOB ACTION
|
||||
ownerJobAction(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 14015,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/activejobstatus", postData);
|
||||
}
|
||||
|
||||
// END POINT FOR OWNER JOB ACTION
|
||||
getFaq() {
|
||||
@@ -740,40 +740,52 @@ class usersService {
|
||||
return this.postAuxEnd("/faq", postData);
|
||||
}
|
||||
|
||||
getMyNotifications() {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
limit: 30,
|
||||
offset: 0,
|
||||
action: 11205,
|
||||
};
|
||||
return this.postAuxEnd("/mynotifications", postData);
|
||||
}
|
||||
|
||||
// END POINT TO GET LIST OF USER PREVIOUS CARDS
|
||||
payListCard() {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 11055
|
||||
action: 11055,
|
||||
};
|
||||
return this.postAuxEnd("/paylistcard", postData);
|
||||
}
|
||||
|
||||
// END POINT TO SEND OFFER INTEREST MESSAGE
|
||||
offerInterestMsg(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 13037,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/offerinterestmsg", postData);
|
||||
}
|
||||
// END POINT TO SEND OFFER INTEREST MESSAGE
|
||||
offerInterestMsg(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 13037,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/offerinterestmsg", postData);
|
||||
}
|
||||
|
||||
// END POINT TO GET OFFER INTEREST MESSAGE
|
||||
offerInterestListMsg(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 13037,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/offerinterestlistmsg", postData);
|
||||
}
|
||||
// END POINT TO GET OFFER INTEREST MESSAGE
|
||||
offerInterestListMsg(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
action: 13037,
|
||||
...reqData,
|
||||
};
|
||||
return this.postAuxEnd("/offerinterestlistmsg", postData);
|
||||
}
|
||||
/*
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||
|
||||
Reference in New Issue
Block a user