From 582e8e5eaca97ec84d409ed1139f8d5a52ec3ccd Mon Sep 17 00:00:00 2001 From: Pooja Belaramani Date: Mon, 23 Dec 2024 13:36:58 +0530 Subject: [PATCH] fix: condition --- .../src/components/ResponsePane/QueryResult/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js index 8adf506a..927b1331 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js @@ -27,11 +27,8 @@ const formatResponse = (data, mode, filter) => { let isValidJSON = false; try { - if (typeof data === 'string') { - isValidJSON = true; - } else { - isValidJSON = typeof JSON.parse(JSON.stringify(data)) === 'object'; - } + isValidJSON = + typeof JSON.parse(JSON.stringify(data)) === 'object' || typeof JSON.parse(JSON.stringify(data)) === 'string'; } catch (error) { console.log('Error parsing JSON: ', error.message); }