Exemple #1
0
        public async Task <Object> ApproveUserRequest(int requestID, [WebHTTP.FromUri] StatusChangeRequest request)
        {
            var userID = User.Claims.FirstOrDefault(p => p.Type == "UserID").Value;

            if (_requestService.CanupdateRequest(requestID, userID))
            {
                var result = await _requestService.ChangeStatus(requestID, request.Status);

                return(result);
            }
            else
            {
                return(BadRequest("User is not allowed to approve time request"));
            }
        }