add place_id on add/edit event, fix media update
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user