Prevent creating a new event when editing one

Close #381

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-10-08 16:16:42 +02:00
parent 5c3e83acfa
commit e895ba32be
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

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