mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 16:43:48 +00:00
activity/location: refactor
Refactor the way for loading locations: * fix showing the default location * fix when there is not thirdparty default location * separate api queries instead of inlines; * use the store instead of the mounted * refactored for a possible re-use in calendar
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import 'es6-promise/auto';
|
||||
import { createStore } from 'vuex';
|
||||
import { postLocation } from 'ChillActivityAssets/vuejs/Activity/api';
|
||||
import {
|
||||
getLocations, getLocationTypeByDefaultFor,
|
||||
getUserCurrentLocation
|
||||
} from "../../../../../ChillActivityBundle/Resources/public/vuejs/Activity/api";
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
|
||||
@@ -82,7 +86,7 @@ const store = createStore({
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
|
||||
|
||||
// ConcernedGroups
|
||||
addPersonsInvolved(state, payload) {
|
||||
//console.log('### mutation addPersonsInvolved', payload.result.type);
|
||||
@@ -94,7 +98,7 @@ const store = createStore({
|
||||
state.activity.thirdParties.push(payload.result);
|
||||
break;
|
||||
case 'user':
|
||||
state.activity.users.push(payload.result);
|
||||
state.activity.users.push(payload.result);
|
||||
break;
|
||||
};
|
||||
},
|
||||
@@ -108,7 +112,7 @@ const store = createStore({
|
||||
state.activity.thirdParties = state.activity.thirdParties.filter(thirdparty => thirdparty !== payload);
|
||||
break;
|
||||
case 'user':
|
||||
state.activity.users = state.activity.users.filter(user => user !== payload);
|
||||
state.activity.users = state.activity.users.filter(user => user !== payload);
|
||||
break;
|
||||
};
|
||||
},
|
||||
@@ -217,9 +221,7 @@ const store = createStore({
|
||||
hiddenLocation.value = value.id;
|
||||
}
|
||||
commit("updateLocation", value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user