Ignore:
Timestamp:
12/28/21 08:56:55 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
b738035
Parents:
84d0fbb
Message:

pre final presentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/PlannerRestController.java

    r84d0fbb rbdd6491  
    8484    }
    8585
     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    }
    8693
     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    }
    87102}
Note: See TracChangeset for help on using the changeset viewer.