public JsonResult AddAjax(string setId)
        {
            var user = HttpContext.User as CustomPrincipal;

            try
            {
                wishlistService.AddSetToWishlistForUser(user.Id, int.Parse(setId), 1);

                return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(new
                {
                    error = true,
                    message = e.Message
                }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 2
0
        public HttpResponseMessage AddSetsToWishlistForUser(WishlistApi newWishlistItems)
        {
            wishlistService.AddSetToWishlistForUser(newWishlistItems.UserId, newWishlistItems.LSetId, newWishlistItems.Number);

            return(Request.CreateResponse(HttpStatusCode.Created, "Item added to wishlist"));
        }