Exemplo n.º 1
0
        public HttpResponseMessage DeleteRotationInterval(string AuthToken, int Id)
        {
            try
            {
                var User = UserRepository.RefreshAuthToken(AuthToken);

                var RotationInterval = ChoreRepository.GetRotationInterval(Id);

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

                return(OKResponse(new _RotationInterval(ChoreRepository.DeleteRotationInterval(Id))));
            }
            catch (Exception ex)
            {
                return(ErrorResponse(ex));
            }
        }