Example #1
0
        public HttpResponseMessage GetRotationInterval(string AuthToken, int Id)
        {
            try
            {
                var User = UserRepository.RefreshAuthToken(AuthToken);

                var RotationIntervalObject = new _RotationInterval(ChoreRepository.GetRotationInterval(Id));

                if (!ChoreRepository.CanEditChoreList(User.Id, RotationIntervalObject.ChoreListId))
                {
                    throw new Exception("Not Authorized");
                }

                return(OKResponse(RotationIntervalObject));
            }
            catch (Exception ex)
            {
                return(ErrorResponse(ex));
            }
        }