public IActionResult AcceptRequest(int requestId)
 {
     try
     {
         requestService.AcceptRequest(requestId);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Beispiel #2
0
        public async Task <IActionResult> AcceptRequest([FromRoute] int requestId, [Required, FromQuery] bool decision)
        {
            try
            {
                await _requestService.AcceptRequest(requestId, decision);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }

            return(Ok());
        }
Beispiel #3
0
        public IActionResult Accept(int id)
        {
            int adminId = int.Parse(HttpContext.Session.GetString("userid"));

            _requestService.AcceptRequest(id, adminId);
            var isRequested = _requestService.SaveChanges();

            if (isRequested != true)
            {
                return(RedirectToAction(nameof(Index)));
            }
            return(RedirectToAction(nameof(Requests)));
        }
 public ActionResult Accept(int id)
 {
     _requestService.AcceptRequest(id);
     return(RedirectToAction("Index"));
 }