[WIP] Добавил возможность просмотра фото
This commit is contained in:
@@ -130,6 +130,7 @@ const state = () => ({
|
||||
protocolData: null,
|
||||
healthState: [
|
||||
{
|
||||
id: 1,
|
||||
year: 2023,
|
||||
pictures: [],
|
||||
comments: [
|
||||
@@ -145,6 +146,7 @@ const state = () => ({
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
year: 2022,
|
||||
pictures: [],
|
||||
comments: [
|
||||
@@ -160,6 +162,7 @@ const state = () => ({
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
year: 2021,
|
||||
pictures: [],
|
||||
comments: [
|
||||
@@ -439,6 +442,9 @@ const getters = {
|
||||
};
|
||||
|
||||
const actions = {
|
||||
deleteItemData({ commit }, props) {
|
||||
commit("setDataWithouDeleted", props);
|
||||
},
|
||||
getBenefitData({ commit }) {
|
||||
fetchWrapper.get("general/benefit/").then((res) => {
|
||||
commit("setBenefitData", res.results);
|
||||
@@ -505,6 +511,11 @@ const actions = {
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
setDataWithouDeleted(state, props) {
|
||||
state[props.stateKey] = state[props.stateKey].filter(
|
||||
(item) => item.id !== props.itemId
|
||||
);
|
||||
},
|
||||
setBenefitData(state, data) {
|
||||
state.benefitData = data;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user