public ActionResult <IEnumerable <ExerciseReadDto> > GetAllExercises() { if (!Request.Headers.ContainsKey("token")) { return(Unauthorized()); } var auth = Request.Headers["token"]; var accountModel = _validate.GetAccountByToken(auth); if (accountModel == null) { return(Unauthorized()); } var ExerciseItems = _repository.GetAllExercises(accountModel.Id); return(Ok(_mapper.Map <IEnumerable <ExerciseReadDto> >(ExerciseItems))); }
public ActionResult <IEnumerable <ExerciseModel> > GetAllExercises() { var exercises = _repo.GetAllExercises(); return(Ok(exercises)); }