- Timestamp:
- 05/02/25 00:37:10 (2 weeks ago)
- Branches:
- main
- Children:
- c44c5ed
- Parents:
- e15e8d9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/rezevirajmasa/demo/web/rest/testController.java
re15e8d9 r2518b3a 181 181 182 182 @PostMapping("/api/reservations") 183 public ResponseEntity<?> createReservation(@RequestBody ReservationDTO reservation) { 184 User user = userService.findByMail(reservation.getUserEmail()); 185 Reservation savedReservation = reservationService.makeReservationRest(reservation, user); 183 public ResponseEntity<?> createReservation(@RequestBody ReservationDTO reservation){ 184 User user = userService.findByMail(reservation.getUserEmail()); 185 Restaurant restaurant = restaurantService.findByIdRestaurant(reservation.getRestaurantId()); 186 Reservation savedReservation = reservationService.makeReservationRest(reservation, user, restaurant); 186 187 187 188 return new ResponseEntity<>(savedReservation, HttpStatus.CREATED); … … 227 228 @PathVariable String email) { 228 229 User user = userService.findByMail(email); 229 230 Restaurant restaurant = restaurantService.findByIdRestaurant(reservationDTO.getRestaurantId()); 230 231 if (!reservationDTO.getReservationID().equals(reservationId)) { 231 232 return ResponseEntity.badRequest().build();
Note:
See TracChangeset
for help on using the changeset viewer.