Get a category of products from Swell
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import {
|
||||
addToCart,
|
||||
getProducts,
|
||||
getProduct,
|
||||
createCart,
|
||||
fetchCart,
|
||||
getProduct,
|
||||
addToCart,
|
||||
updateCartItem,
|
||||
removeCartItem,
|
||||
updateCartItem
|
||||
} from '$utils/functions/swell'
|
||||
|
||||
|
||||
@@ -28,6 +29,10 @@ export async function post ({ headers, query, body, params, ...rest }) {
|
||||
|
||||
if (bodyParsed) {
|
||||
switch (action) {
|
||||
case 'getProducts': {
|
||||
result = await getProducts(bodyParsed.category)
|
||||
break
|
||||
}
|
||||
case 'getProduct': {
|
||||
result = await getProduct(productId)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user