예제 #1
0
        public ActionResult CancelFavoriteShop(int shopId)
        {
            try
            {
                UserModel userModel = new UserModel();
                UserInfo userInfo = userModel.GetUserInfo(User.Identity.Name);
                UserFavoriteShop favShop = userModel.GetUserFavoriteShop(shopId, userInfo.Id);
                userModel.Delete(favShop);
            }
            catch(Exception ex)
            {
                return Json(new { type = 0, data = ex.Message }, JsonRequestBehavior.AllowGet);
            }

            return Json(new { type = 1 }, JsonRequestBehavior.AllowGet);
        }