Ejemplo n.º 1
0
        public IActionResult CancelRequest([FromBody] string id)
        {
            if (id == null)
            {
                return(BadRequest("invalid object"));
            }
            string          email  = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
            ApplicationUser user   = context.ApplicationUsers.FirstOrDefault(c => c.Email.Equals(email));
            string          result = IRiderService.CancelRequest(user, id);

            if (result == "Ok")
            {
                return(Ok(new
                {
                    status = 200,
                    message = "Request Cancelled Successfully."
                }));
            }
            return(BadRequest(new
            {
                error = result
            }));
        }