mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
fix Location POST endpoint and saveNewLocation event method in vue_activity Location
This commit is contained in:
@@ -71,20 +71,19 @@ export default {
|
||||
},
|
||||
saveNewLocation(selected) {
|
||||
console.log('saveNewLocation', selected);
|
||||
console.log('post location')
|
||||
let body = {
|
||||
type: 'location',
|
||||
name: selected.name,
|
||||
address: { id: selected.addressId },
|
||||
locationtype: { id: selected.type },
|
||||
locationType: { id: selected.type, type: 'location-type' },
|
||||
email: selected.email,
|
||||
phonenumber1: selected.phonenumber1,
|
||||
phonenumber2: selected.phonenumber2,
|
||||
}
|
||||
//this.$store.dispatch('addLocationSelected', body);
|
||||
postLocation(body).then(location => new Promise(resolve => {
|
||||
console.log('postLocation', location);
|
||||
this.locations.push(location);
|
||||
this.location.set(location);
|
||||
this.$store.dispatch('updateLocation', location);
|
||||
resolve();
|
||||
}));
|
||||
}
|
||||
|
@@ -55,7 +55,10 @@
|
||||
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<button class="btn btn-save" @click.prevent="$emit('saveNewLocation', selected)">Enregistrer</button>
|
||||
<button class="btn btn-save"
|
||||
@click.prevent="$emit('saveNewLocation', selected); modal.showModal = false;">
|
||||
Enregistrer
|
||||
</button>
|
||||
</template>
|
||||
|
||||
</modal>
|
||||
|
Reference in New Issue
Block a user