mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
activity: add user current location as default for a new activity
This commit is contained in:
@@ -55,16 +55,17 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getLocationsList();
|
||||
getLocations().then(response => new Promise(resolve => {
|
||||
console.log('getLocations', response);
|
||||
this.locations = response.results;
|
||||
if (window.default_location_id) {
|
||||
let location = this.locations.filter(l => l.id === window.default_location_id);
|
||||
this.$store.dispatch('updateLocation', location);
|
||||
}
|
||||
resolve();
|
||||
}))
|
||||
},
|
||||
methods: {
|
||||
getLocationsList() {
|
||||
getLocations().then(response => new Promise(resolve => {
|
||||
console.log('getLocations', response);
|
||||
this.locations = response.results;
|
||||
resolve();
|
||||
}))
|
||||
},
|
||||
customLabel(value) {
|
||||
return `${value.locationType.title.fr} ${value.name ? value.name : ''}`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user