4
0
forked from crowetic/commerce
2020-10-19 11:30:49 -05:00

21 lines
433 B
TypeScript

import type { Wishlist, WishlistHandlers } from '..'
// Return wishlist info
const getWishlist: WishlistHandlers['getWishlist'] = async ({
res,
body: { wishlistId },
config,
}) => {
let result: { data?: Wishlist } = {}
try {
result = await config.storeApiFetch(`/v3/wishlists/${wishlistId}`)
} catch (error) {
throw error
}
res.status(200).json({ data: result.data ?? null })
}
export default getWishlist