Merge branch '61-add-get-request-for-one-automation' into 'dev'

new route fix

Closes #61

See merge request sa4-2020/the-sanmarinoes/backend!88
This commit is contained in:
Matteo Omenetti 2020-04-26 12:17:21 +02:00
commit 46bb2e7d26

View file

@ -51,6 +51,11 @@ public class AutomationController {
.collect(Collectors.toList()); .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) { private Automation save(Automation newRL, AutomationSaveRequest s) {
newRL.setName(s.getName()); newRL.setName(s.getName());