public IHttpActionResult RemoveFavorite(string userId, int listingId)
 {
     try {
         _svc.RemoveFavorite(userId, listingId);
         return(Ok());
     }
     catch (Exception ex) {
         return(BadRequest(ex.Message));
     }
 }
Beispiel #2
0
        [HttpPost] // POST: /MyAccount/DeleteFavorite
        public ActionResult DeleteFavorite(int listingId)
        {
            var userId = Util.GetUserId(this);

            //var repo = AccountRepositoryFactory.GetRepository();
            //var model = repo.RemoveFavorite(userId, listingId);

            _svc.RemoveFavorite(userId, listingId);

            return(RedirectToAction("Favorites"));
        }