fix media name

This commit is contained in:
lesion
2021-11-11 16:56:08 +01:00
parent e8fe68be30
commit 49982ceb1d
2 changed files with 6 additions and 3 deletions

View File

@@ -42,7 +42,7 @@
:hint="$t('event.media_description')" :hint="$t('event.media_description')"
prepend-icon="mdi-camera" prepend-icon="mdi-camera"
:value='value.image' :value='value.image'
@change="v => $emit('input', { image: v, focalpoint: [0, 0] })" @change="selectMedia"
persistent-hint persistent-hint
accept='image/*') accept='image/*')
</template> </template>
@@ -79,7 +79,7 @@ export default {
}, },
methods: { methods: {
save () { 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 this.openMediaDetails = false
}, },
async remove () { async remove () {
@@ -87,6 +87,9 @@ export default {
if (!ret) { return } if (!ret) { return }
this.$emit('remove') this.$emit('remove')
}, },
selectMedia (v) {
this.$emit('input', { image: v, name: v.name, focalpoint: [0, 0] })
},
selectFocal (ev) { selectFocal (ev) {
const boundingClientRect = ev.target.getBoundingClientRect() const boundingClientRect = ev.target.getBoundingClientRect()

View File

@@ -130,7 +130,7 @@ if (config.firstrun) {
api.put('/event/unconfirm/:event_id', isAuth, eventController.unconfirm) api.put('/event/unconfirm/:event_id', isAuth, eventController.unconfirm)
// get event // get event
api.get('/event/:event_id.:format?', cors, eventController.get) api.get('/event/:event_slug.:format?', cors, eventController.get)
// export events (rss/ics) // export events (rss/ics)
api.get('/export/:type', cors, exportController.export) api.get('/export/:type', cors, exportController.export)