- Timestamp:
- 12/28/21 08:56:55 (3 years ago)
- Branches:
- master
- Children:
- b738035
- Parents:
- 84d0fbb
- Location:
- trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java
r84d0fbb rbdd6491 5 5 import finki.diplomska.tripplanner.service.LocationService; 6 6 import finki.diplomska.tripplanner.service.PlannerService; 7 import org.springframework.data.repository.query.Param;8 7 import org.springframework.http.ResponseEntity; 9 8 import org.springframework.web.bind.annotation.*; … … 77 76 return this.locationService.getAllLocationIdsForPlanner(plannerId); 78 77 } 78 79 79 } -
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.