From 7f7795ec87a271171c44c98e9a1096d13c63ab19 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Tue, 27 Oct 2020 00:52:09 -0500 Subject: [PATCH] /checkout redirects to cart if no cookie is set --- lib/bigcommerce/api/checkout.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bigcommerce/api/checkout.ts b/lib/bigcommerce/api/checkout.ts index aab7c0d7a..530f4c40a 100644 --- a/lib/bigcommerce/api/checkout.ts +++ b/lib/bigcommerce/api/checkout.ts @@ -16,7 +16,8 @@ const checkoutApi: BigcommerceApiHandler = async (req, res, config) => { try { if (!cartId) { - return res.status(404).end() + res.redirect('/cart') + return } const { data } = await config.storeApiFetch(