[WIP] Добавил поиск на модальное окно выбора льгот, правки кода

This commit is contained in:
megavrilinvv
2023-04-20 16:22:25 +03:00
parent 3776ac6c7d
commit 4e2865d143
5 changed files with 94 additions and 34 deletions

View File

@@ -47,6 +47,7 @@ const state = () => ({
},
benefit: {
id: null,
discount: null,
name: null,
photo: null,
},
@@ -129,6 +130,7 @@ const getters = {
benefit: {
name: person?.benefit?.name,
id: person?.benefit?.id,
discount: person?.benefit?.discount,
photo: person?.photo_benefit
? {
photo: rootState.getUrl + person?.photo_benefit,
@@ -212,6 +214,14 @@ const actions = {
commit("setBenefitData", res.results);
});
},
getBenefitDataSearch({ commit }) {
fetchWrapper
.get(`general/benefit/?name=${localStorage.getItem("searchBenefit")}`)
.then((res) => {
commit("setBenefitData", res.results);
});
},
getMedicalCardData({ commit }) {
fetchWrapper
.get(