type localized added

This commit is contained in:
VividTruthKeeper 2022-05-06 00:41:53 +05:00
parent 37867c1381
commit e531580f62
3 changed files with 11 additions and 4 deletions

View File

@ -18,8 +18,8 @@ const CardStage3 = ({ setStage, data, setData }) => {
const { locale } = useContext(LanguageContext);
const branch = branchData();
const [inputValid, setInputValid] = useState({
region: data.region ? data.region : null,
affiliate: data.branch ? data.branch : null,
region: data.region_localized ? data.region_localized : null,
affiliate: data.branch_localized ? data.branch_localized : null,
date: data.date_arrival_bank ? data.date_arrival_bank : null,
time: data.selected_time ? data.selected_time : null,
code: data.the_codeword ? data.the_codeword : null,

View File

@ -15,7 +15,10 @@ const CreditStage1 = ({ setStage, data, setData, creditData, id, setId }) => {
rus: "",
TKM: "",
});
const [input, setInput] = useState(data.type ? data.type : null);
const [input, setInput] = useState(
data.type_localized ? data.type_localized : null
);
const [inputValid, setInputValid] = useState(data.type ? data.type : null);
const [dropdown, setDropdown] = useState({
one: false,
two: false,
@ -33,6 +36,7 @@ const CreditStage1 = ({ setStage, data, setData, creditData, id, setId }) => {
).includes(input)
) {
setId(el.id);
setInputValid(el.name);
setReq({
...req,
TKM: el.documents,
@ -42,6 +46,7 @@ const CreditStage1 = ({ setStage, data, setData, creditData, id, setId }) => {
});
}
}, [input]);
return (
<section className="cs-1">
<form>
@ -212,7 +217,7 @@ const CreditStage1 = ({ setStage, data, setData, creditData, id, setId }) => {
className="sign-btn cd-btn"
onClick={() => {
setStage(2);
setData({ ...data, type: input });
setData({ ...data, type: inputValid, type_localized: input });
}}
>
<div>

View File

@ -29,6 +29,8 @@ const CreditStage6 = ({
const token = localStorage.getItem("userToken");
const postUrl = destination + "/online_credit";
const getUrl = destination + "/me";
console.log(data.type, data.type_localized);
return (
<section className="card-stage-6">
<div className="cd-6-top">