diff --git a/pages/add/MediaInput.vue b/pages/add/MediaInput.vue index d09b8159..58ad790b 100644 --- a/pages/add/MediaInput.vue +++ b/pages/add/MediaInput.vue @@ -42,7 +42,7 @@ :hint="$t('event.media_description')" prepend-icon="mdi-camera" :value='value.image' - @change="v => $emit('input', { image: v, focalpoint: [0, 0] })" + @change="selectMedia" persistent-hint accept='image/*') @@ -79,7 +79,7 @@ export default { }, methods: { save () { - this.$emit('input', { url: this.value.url, image: this.value.image, name: this.name || '', focalpoint: [...this.focalpoint] }) + this.$emit('input', { url: this.value.url, image: this.value.image, name: this.name || this.value.image.name || '', focalpoint: [...this.focalpoint] }) this.openMediaDetails = false }, async remove () { @@ -87,6 +87,9 @@ export default { if (!ret) { return } this.$emit('remove') }, + selectMedia (v) { + this.$emit('input', { image: v, name: v.name, focalpoint: [0, 0] }) + }, selectFocal (ev) { const boundingClientRect = ev.target.getBoundingClientRect() diff --git a/server/api/index.js b/server/api/index.js index d271276e..4b87de93 100644 --- a/server/api/index.js +++ b/server/api/index.js @@ -130,7 +130,7 @@ if (config.firstrun) { api.put('/event/unconfirm/:event_id', isAuth, eventController.unconfirm) // get event - api.get('/event/:event_id.:format?', cors, eventController.get) + api.get('/event/:event_slug.:format?', cors, eventController.get) // export events (rss/ics) api.get('/export/:type', cors, exportController.export)