From 10dc0c97415f94de4c488c5544c2f4c30f698a58 Mon Sep 17 00:00:00 2001 From: omenem Date: Sun, 26 Apr 2020 12:13:46 +0200 Subject: [PATCH] new route fix --- .../smarthut/controller/AutomationController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java index f888481..445bb83 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java @@ -51,6 +51,11 @@ public class AutomationController { .collect(Collectors.toList()); } + @GetMapping("/{id}") + public Automation get(@PathVariable long id) throws NotFoundException { + return automationRepository.findById(id).orElseThrow(NotFoundException::new); + } + private Automation save(Automation newRL, AutomationSaveRequest s) { newRL.setName(s.getName());