From e895ba32be73cf675e2299138af133e761e57296 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 8 Oct 2020 16:16:42 +0200 Subject: [PATCH] Prevent creating a new event when editing one Close #381 Signed-off-by: Thomas Citharel --- js/src/views/Event/Edit.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue index a22f8dc80..816a9171f 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -517,9 +517,11 @@ export default class EditEvent extends Vue { createOrUpdateDraft(e: Event): void { e.preventDefault(); if (this.validateForm()) { - if (this.eventId && !this.isDuplicate) this.updateEvent(); - - this.createEvent(); + if (this.eventId && !this.isDuplicate) { + this.updateEvent(); + } else { + this.createEvent(); + } } }