hotfix for citizenships

This commit is contained in:
merelendor 2023-04-20 12:36:12 +03:00
parent 060fb672e4
commit 67eac69bd5
2 changed files with 35 additions and 7 deletions

View File

@ -89,6 +89,26 @@ export const getQuestionnaire = ({ dispatch, id }) =>
}
};
const identity_document_template =
{
doctype: "",
seria: "",
docnumber: "",
issuedate: "",
icode: "",
issueby: "",
issueby_search_dadata: "",
placebirth: "",
citizenship: {
title: "",
code: "",
},
registration_address: {
title: "",
fias_id: "",
}
};
const questionnaire = JSON.parse(JSON.stringify(global.store.getState().questionnaire));
if(questionnaire.status === "empty")
{
@ -111,6 +131,7 @@ export const getQuestionnaire = ({ dispatch, id }) =>
{
questionnaire.head_person.identity_document = head_person_identity_document;
}
questionnaire.head_person.identity_document.citizenship = {
title: response.data.head_person !== null && response.data.head_person.identity_document !== null ? getCitizenshipTitleByCode(response.data.head_person.identity_document.citizenship_code) : null,
code: response.data.head_person !== null && response.data.head_person.identity_document !== null ? response.data.head_person.identity_document.citizenship_code : 643,
@ -118,15 +139,16 @@ export const getQuestionnaire = ({ dispatch, id }) =>
const signatory_person_identity_document = questionnaire.signatory_person.identity_document;
questionnaire.signatory_person = { ...questionnaire.signatory_person, ...response.data.signatory_person };
questionnaire.signatory_person.identity_document.citizenship = {
title: response.data.signatory_person !== null && response.data.signatory_person.identity_document !== null ? getCitizenshipTitleByCode(response.data.signatory_person.identity_document.citizenship_code) : null,
code: response.data.signatory_person !== null && response.data.signatory_person.identity_document !== null ? response.data.signatory_person.identity_document.citizenship_code : 643,
};
if(questionnaire.signatory_person.identity_document === null)
{
questionnaire.signatory_person.identity_document = signatory_person_identity_document;
}
questionnaire.signatory_person.identity_document.citizenship = {
title: response.data.signatory_person !== null && response.data.signatory_person.identity_document !== null ? getCitizenshipTitleByCode(response.data.signatory_person.identity_document.citizenship_code) : null,
code: response.data.signatory_person !== null && response.data.signatory_person.identity_document !== null ? response.data.signatory_person.identity_document.citizenship_code : 643,
};
for(let i in response.data.founder_persons)
{
questionnaire.founder_persons[i] = response.data.founder_persons[i];

View File

@ -21,7 +21,7 @@ import AccountLayout from "./components/Layout/Account";
import AnnouncementsList from "./components/AnnouncementsList";
import { getContractsList, getImage } from '../actions';
import { getCompanyInfo, getContractsList, getImage } from '../actions';
class IndexPage extends React.Component
{
@ -59,11 +59,17 @@ class IndexPage extends React.Component
componentDidMount()
{
const { dispatch } = this.props;
this.setState({ loading: true }, () =>
{
getContractsList({ dispatch: this.props.dispatch, order: this.state.order, sort: this.state.sort_number, }).then(() => {
getCompanyInfo({ dispatch }).then(() => {}).catch(() => {});
getContractsList({ dispatch, order: this.state.order, sort: this.state.sort_number, })
.then(() =>
{
this.setState({ loading: false });
}).catch(() => {});
})
.catch(() => {});
});
}