From 5066afbb92c46492b34dad6fcd17ddce4a8adf61 Mon Sep 17 00:00:00 2001 From: Marc Beyer Date: Mon, 31 Jan 2022 21:16:19 +0100 Subject: [PATCH] Fixed user/edit --- .../main/java/com/vpr/server/controller/EventController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/vpr/server/controller/EventController.java b/server/src/main/java/com/vpr/server/controller/EventController.java index 28cee56..0421abc 100644 --- a/server/src/main/java/com/vpr/server/controller/EventController.java +++ b/server/src/main/java/com/vpr/server/controller/EventController.java @@ -127,13 +127,14 @@ public class EventController { return new ResponseEntity<>("Drr Termin ist doppelt vorhanden. (Um das zu lösen versuche den Termin zu löschen und erneut zu erstellen)", HttpStatus.BAD_REQUEST); } + ResponseEntity error = createEventAndUserEvent(userId, newDate, newName, newStart, newEnd, newPriority, newIsFullDay, newIsPrivate); + if (error != null) return error; + eventRepository.deleteUserEventsById(userId, eventId, date); if(eventDAO.getAllEventsWithId(eventId).size() == 0){ eventRepository.deleteById(eventId); } - ResponseEntity BAD_REQUEST = createEventAndUserEvent(userId, newDate, newName, newStart, newEnd, newPriority, newIsFullDay, newIsPrivate); - if (BAD_REQUEST != null) return BAD_REQUEST; return new ResponseEntity<>("", HttpStatus.OK); }