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

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

                return(OKResponse(new _ChoreList(ChoreRepository.DeleteChoreList(Id))));
            }
            catch (Exception ex)
            {
                return(ErrorResponse(ex));
            }
        }