From 4763386d84cd32d6fe4a07cebc1657f8f4b70387 Mon Sep 17 00:00:00 2001 From: lakshmithi Date: Tue, 12 Nov 2024 11:57:36 +0530 Subject: [PATCH] fix for console error when quote cart is empty[#1294] --- blocks/header/header.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 4aedb034e..7a79df32d 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -663,8 +663,8 @@ function handleScroll() { async function getQuote(headerBlock, authHeader) { const quoteRequest = await fetch(`${baseURL}/rfqcart/-`, { headers: authHeader }); - if (quoteRequest.ok) { - const data = await quoteRequest.json(); + if (quoteRequest.status === 200) { + const data = await quoteRequest?.json(); if (data && data.items) { const rfqQuantity = data.items.length; if (rfqQuantity !== 0) {