예제 #1
0
        public async Task <IActionResult> Update([FromBody] UpdateReservationDTO updatedReservation)
        {
            // check if requester is allowed to update this reservation
            if (!await _permissionService.CanUpdateReservation(updatedReservation.Id, HttpContext.GetUserIdFromToken()))
            {
                return(Forbid());
            }

            return(Ok(await _reservationService.UpdateReservation(updatedReservation)));
        }