Merge branch 'fix-event-creation-on-update' into 'master'

Prevent creating a new event when editing one

Closes #381

See merge request framasoft/mobilizon!595
This commit is contained in:
Thomas Citharel 2020-10-08 16:35:11 +02:00
commit 6a1d74d07e

View file

@ -517,11 +517,13 @@ export default class EditEvent extends Vue {
createOrUpdateDraft(e: Event): void { createOrUpdateDraft(e: Event): void {
e.preventDefault(); e.preventDefault();
if (this.validateForm()) { if (this.validateForm()) {
if (this.eventId && !this.isDuplicate) this.updateEvent(); if (this.eventId && !this.isDuplicate) {
this.updateEvent();
} else {
this.createEvent(); this.createEvent();
} }
} }
}
createOrUpdatePublish(e: Event): void { createOrUpdatePublish(e: Event): void {
e.preventDefault(); e.preventDefault();