public async void AddProduct([FromHeader] string auth, [FromForm] string uid, [FromForm] string product) { string user; if ((user = JwtBuilder.UserJwtToken(auth).Result) == null || !UserStore.Exists(user).Result) { HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized; return; } HttpContext.Response.Headers.Add("auth", auth); var wishL = WishlistStore.Get(uid, user).Result; if (wishL == null) { HttpContext.Response.StatusCode = (int)HttpStatusCode.NotFound; return; } await WishlistStore.Add_prod(uid, product, user); }
public Inventory <Product> Info([FromRoute] string uid, [FromHeader] string auth) { string user; if ((user = JwtBuilder.UserJwtToken(auth).Result) == null || !UserStore.Exists(user).Result) { HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized; return(null); } HttpContext.Response.Headers.Add("auth", auth); var wishL = WishlistStore.Get(uid, user).Result; if (wishL != null) { return(wishL); } HttpContext.Response.StatusCode = (int)HttpStatusCode.NotFound; return(null); //return new Inventory<Product>(); }