Api request for working with cart API
Methods
# async inner fetchCartItems() → {array}
A function to fetch cart items from the database
items in cart
array
# inner fetchClearCart() → {Promise}
Promise object represents the response from the server
Promise
# inner fetchPoductUpdate(product) → {Promise}
Parameters:
| Name | Type | Description |
|---|---|---|
product |
object |
Promise object represents the response from the server
Promise
# inner fetchProductRemoveFromCart(productId) → {Promise}
Parameters:
| Name | Type | Description |
|---|---|---|
productId |
string |
Promise object represents the response from the server
Promise
# inner fetchProductToCart(product) → {Promise}
A function to add product to cart
Parameters:
| Name | Type | Description |
|---|---|---|
product |
object |
Promise object represents the response from the server
Promise
# async inner fetchTestCartItems() → {Promise}
A function to fetch test cart items
Promise object respesents the response from the server
Promise
# inner withCredentials(productId) → {string}
A function to get proper url to connect to the database
Parameters:
| Name | Type | Description |
|---|---|---|
productId |
string | product id |
url
string