WIP Добавил выбор соцсети и доверенного лица из существующих персон

This commit is contained in:
DwCay
2023-04-25 19:10:36 +03:00
parent 4ec192a423
commit bfb7e388b3
3 changed files with 136 additions and 46 deletions

View File

@@ -4,6 +4,7 @@ import { genderOptions } from "@/pages/newMedicalCard/utils/medicalConfig";
const state = () => ({
medicalCard: {},
confidantData: [],
personFiltredList: [],
contactsData: {
phones: [],
emails: [],
@@ -252,6 +253,15 @@ const actions = {
commit("setConfidantData");
});
},
getPersonsFiltredList({ commit }) {
fetchWrapper
.get(
`general/person/?last_name=${localStorage.getItem("searchConfidant")}`
)
.then((res) => {
commit("setPersonFiltredList", res.results);
});
},
returnInitData({ commit }) {
commit("setBasicData");
commit("setContactsData");
@@ -295,6 +305,9 @@ const mutations = {
setConfidantData(state) {
state.confidantData = this.getters.getConfidantData;
},
setPersonFiltredList(state, persons) {
state.personFiltredList = persons;
},
};
export default {