location saving is not working when geocoding is disabled, fix #238
This commit is contained in:
@@ -232,8 +232,8 @@ export default {
|
|||||||
}
|
}
|
||||||
formData.append('place_name', this.event.place.name.trim())
|
formData.append('place_name', this.event.place.name.trim())
|
||||||
formData.append('place_address', this.event.place.address)
|
formData.append('place_address', this.event.place.address)
|
||||||
formData.append('place_latitude', this.event.place.latitude)
|
if (this.event.place.latitude) { formData.append('place_latitude', this.event.place.latitude) }
|
||||||
formData.append('place_longitude', this.event.place.longitude)
|
if (this.event.place.longitude) { formData.append('place_longitude', this.event.place.longitude) }
|
||||||
formData.append('description', this.event.description)
|
formData.append('description', this.event.description)
|
||||||
formData.append('multidate', !!this.date.multidate)
|
formData.append('multidate', !!this.date.multidate)
|
||||||
let [hour, minute] = this.date.fromHour.split(':')
|
let [hour, minute] = this.date.fromHour.split(':')
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ const eventController = {
|
|||||||
return place
|
return place
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.error('dentro findOrCreatePlace', body)
|
||||||
|
|
||||||
const place_name = body.place_name && body.place_name.trim()
|
const place_name = body.place_name && body.place_name.trim()
|
||||||
const place_address = body.place_address && body.place_address.trim()
|
const place_address = body.place_address && body.place_address.trim()
|
||||||
if (!place_address || !place_name) {
|
if (!place_address || !place_name) {
|
||||||
@@ -39,8 +41,8 @@ const eventController = {
|
|||||||
place = await Place.create({
|
place = await Place.create({
|
||||||
name: place_name,
|
name: place_name,
|
||||||
address: place_address,
|
address: place_address,
|
||||||
latitude: body.place_latitude,
|
latitude: Number(body.place_latitude) || null,
|
||||||
longitude: body.place_longitude
|
longitude: Number(body.place_longitude) || null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return place
|
return place
|
||||||
@@ -390,6 +392,7 @@ const eventController = {
|
|||||||
return res.status(400).send(`Place not found`)
|
return res.status(400).send(`Place not found`)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
log.error(e.message)
|
||||||
return res.status(400).send(e.message)
|
return res.status(400).send(e.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user