4
0
forked from crowetic/commerce
2022-12-21 09:51:55 -06:00

20 lines
450 B
TypeScript

import type { CheckoutEndpoint } from '.'
const submitCheckout: CheckoutEndpoint['handlers']['submitCheckout'] = async ({
req,
body: { cartId },
config: { restBuyerFetch, tokenCookie },
}) => {
const token = req.cookies.get(tokenCookie)?.value
// Submit order
await restBuyerFetch('POST', `/orders/Outgoing/${cartId}/submit`, null, {
token,
})
// Return cart and errors
return { data: null }
}
export default submitCheckout