add place_id on add/edit event, fix media update

This commit is contained in:
lesion
2022-05-06 23:02:43 +02:00
parent 82ae4b1be9
commit 5bce9cf289
3 changed files with 33 additions and 17 deletions

View File

@@ -75,6 +75,7 @@ export default {
if (typeof p === 'object' && !p.create) {
this.place.name = p.name.trim()
this.place.address = p.address
this.place.id = p.id
this.disableAddress = true
} else { // this is a new place
this.place.name = p.name || p
@@ -83,9 +84,11 @@ export default {
const place = this.places.find(p => p.name.toLowerCase() === tmpPlace)
if (place) {
this.place.name = place.name
this.place.id = place.id
this.place.address = place.address
this.disableAddress = true
} else {
delete this.place.id
this.place.address = ''
this.disableAddress = false
this.$refs.place.blur()

View File

@@ -187,12 +187,15 @@ export default {
if (this.event.media.length) {
formData.append('image', this.event.media[0].image)
formData.append('image_url', this.event.media[0].url)
// formData.append('image_url', this.event.media[0].url)
formData.append('image_name', this.event.media[0].name)
formData.append('image_focalpoint', this.event.media[0].focalpoint)
}
formData.append('title', this.event.title)
if (this.event.place.id) {
formData.append('place_id', this.event.place.id)
}
formData.append('place_name', this.event.place.name)
formData.append('place_address', this.event.place.address)
formData.append('description', this.event.description)