public ActionResult Interested(ListingInterestedModel model) { if(Request.IsAjaxRequest()) return Json(Status.OK<long>(model.BuildingId)); return Redirect("/listing/" + model.BuildingId); }
public ActionResult Interested(ListingInterestedModel model) { if (Request.IsAjaxRequest()) { var status = this.listingAdapter.CreateInterestInBuilding( User.Identity.Name, model.BuildingId, model.Content ); if (status.StatusCode != 200) return Json(Status.Error<bool>(status.Message, false)); return Json(Status.OK<bool>(true)); } return Redirect("/listing/" + model.BuildingId); }