From 9cb074b2ec2aeeb0128b3c540716ca5a0cd94e96 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Tue, 31 May 2022 09:25:53 +0200 Subject: [PATCH] Fixed rs deletion. --- .../java/nl/andrewl/railsignalapi/service/RailSystemService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/nl/andrewl/railsignalapi/service/RailSystemService.java b/src/main/java/nl/andrewl/railsignalapi/service/RailSystemService.java index b5d7267..9367fa3 100644 --- a/src/main/java/nl/andrewl/railsignalapi/service/RailSystemService.java +++ b/src/main/java/nl/andrewl/railsignalapi/service/RailSystemService.java @@ -45,6 +45,7 @@ public class RailSystemService { .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND)); componentRepository.deleteAllByRailSystem(rs); segmentRepository.deleteAllByRailSystem(rs); + rs.setSettings(null); railSystemRepository.delete(rs); }