public IActionResult AddStopRouteToFavourites([FromBody] FavouriteStopRouteModel favouriteStop) { return(Json(new { succeeded = _context.AddStopRouteToFavourites(favouriteStop) })); }
public async Task <IActionResult> AddToFavourite(FavouriteStopRouteModel favouriteStop) { if (ModelState.IsValid) { ApplicationUser user = await _userManager.GetUserAsync(HttpContext.User); favouriteStop.UserId = user.Id; return(Json(_context.AddStopRouteToFavourites(favouriteStop))); } return(Json(false)); }