Beispiel #1
0
        public async Task UpdateWorkoutAsync(int workoutId, UpdateWorkoutRequest workoutUpdateDto)
        {
            Workout workout = await _workoutRepo.GetWorkoutByIdAsync(workoutId);

            _mapper.Map(workoutUpdateDto, workout);
            await _unitOfWork.SaveAllAsync();
        }
        public async Task <IActionResult> UpdateWorkout(int workoutId, UpdateWorkoutRequest updateWorkoutRequest)
        {
            await _ownedAuthService.OwnsAsync <Workout>(workoutId, User.GetUserId());

            await _workoutService.UpdateWorkoutAsync(workoutId, updateWorkoutRequest);

            return(NoContent());
        }