Changeset bdd6491 for trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/PlannerRestController.java
- Timestamp:
- 12/28/21 08:56:55 (3 years ago)
- Branches:
- master
- Children:
- b738035
- Parents:
- 84d0fbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/PlannerRestController.java
r84d0fbb rbdd6491 84 84 } 85 85 86 @DeleteMapping("/delete/{id}") 87 public ResponseEntity deleteById(@PathVariable Long id) { 88 this.plannerService.deletePlannerById(id); 89 return this.plannerService.findById(id) 90 .map(planner -> ResponseEntity.ok().body(planner)) 91 .orElseGet(()-> ResponseEntity.notFound().build()); 92 } 86 93 94 95 @DeleteMapping(value = "/delete-from-planner") 96 public ResponseEntity deleteLocationFromPlanner(@PathVariable Long locationId){ 97 this.plannerService.deleteLocationFromPlanner(locationId); 98 return this.locationService.findById(locationId) 99 .map(location -> ResponseEntity.ok().body(location)) 100 .orElseGet(()-> ResponseEntity.notFound().build()); 101 } 87 102 }
Note:
See TracChangeset
for help on using the changeset viewer.