Esempio n. 1
0
 public async Task <IActionResult> ApproveRequest(string response, int requestId)
 {
     _requestService.SetRequesterId(User.FindFirst(ClaimTypes.NameIdentifier).Value);
     if (await _requestService.ApproveRequest(requestId))
     {
         return(Ok());
     }
     else
     {
         return(BadRequest());
     }
 }
Esempio n. 2
0
 public IActionResult Approve(int id)
 {
     try
     {
         service.ApproveRequest(id);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Esempio n. 3
0
 public IActionResult Approve(int requestId)
 {
     service.ApproveRequest(requestId);
     return(RedirectToAction("Pending"));
 }