Changeset b738035 for trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/PlannerRestController.java
- Timestamp:
- 01/24/22 21:08:32 (3 years ago)
- Branches:
- master
- Children:
- 76712b2
- Parents:
- bdd6491
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/PlannerRestController.java
rbdd6491 rb738035 5 5 import finki.diplomska.tripplanner.models.User; 6 6 import finki.diplomska.tripplanner.models.dto.PlannerDto; 7 import finki.diplomska.tripplanner.models.dto.PlannerLocationDto; 7 8 import finki.diplomska.tripplanner.service.LocationService; 8 9 import finki.diplomska.tripplanner.service.PlannerService; … … 92 93 } 93 94 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()); 95 @DeleteMapping(value = "/delete-location") 96 public ResponseEntity deleteLocationFromPlanner(@RequestBody PlannerLocationDto plannerLocationDto){ 97 return this.plannerService.deleteLocationFromPlanner(plannerLocationDto); 101 98 } 102 99 }
Note:
See TracChangeset
for help on using the changeset viewer.