コード例 #1
0
        public async Task <IActionResult> AddExercise(ExerciseAddDto exerciseAddDto, int workoutId)
        {
            if (!await _workoutService.UserHasWorkout(User.GetUserId(), workoutId))
            {
                return(Unauthorized("You dont own this workout"));
            }

            await _exerciseService.AddExerciseToWorkout(exerciseAddDto, workoutId);

            //createdatroute? create a httpget getexercises
            return(NoContent());
        }