From 11bfda92bae62382e4f709ba43526f34f090b9df Mon Sep 17 00:00:00 2001 From: Gulshan Ramnath Prajapati <35621580+gulshanAI@users.noreply.github.com> Date: Thu, 22 Sep 2022 15:20:56 +0530 Subject: [PATCH] both statement have dupplicate bodies (#8633) --- rest_framework/static/rest_framework/docs/js/api.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rest_framework/static/rest_framework/docs/js/api.js b/rest_framework/static/rest_framework/docs/js/api.js index e6120cd8eb..21663deb67 100644 --- a/rest_framework/static/rest_framework/docs/js/api.js +++ b/rest_framework/static/rest_framework/docs/js/api.js @@ -131,13 +131,7 @@ $(function () { if (value !== undefined) { params[paramKey] = value } - } else if (dataType === 'array' && paramValue) { - try { - params[paramKey] = JSON.parse(paramValue) - } catch (err) { - // Ignore malformed JSON - } - } else if (dataType === 'object' && paramValue) { + } else if ((dataType === 'array' && paramValue) || (dataType === 'object' && paramValue)) { try { params[paramKey] = JSON.parse(paramValue) } catch (err) {