Get a category of products from Swell

This commit is contained in:
2021-11-08 13:24:33 +01:00
parent 378a64f2b0
commit 75f3e5f1d1
4 changed files with 59 additions and 20 deletions

View File

@@ -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