From 143649ff608495fd3591fb72179c50bf776abd8f Mon Sep 17 00:00:00 2001 From: Alex Anderson <191496+alxndrsn@users.noreply.github.com> Date: Mon, 18 Mar 2024 18:10:32 +0300 Subject: [PATCH] formats/odata: de-manualise JSON.stringify(Array) (#1109) --- lib/formats/odata.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/formats/odata.js b/lib/formats/odata.js index 04a519f56..37eea278c 100644 --- a/lib/formats/odata.js +++ b/lib/formats/odata.js @@ -537,9 +537,9 @@ const singleRowToOData = (fields, row, domain, originalUrl, query) => { paredRefined = options.metadata && !options.metadata.__id ? paredRefined.map(p => without(['__id'], p)) : paredRefined; // and finally splice together and return our result: - const dataContents = paredRefined.map(JSON.stringify).join(','); + const dataContents = JSON.stringify(paredRefined); const footerContents = jsonDataFooter({ table, domain, serviceRoot, nextUrl, count: (shouldCount ? count : null) }); - return `{"value":[${dataContents}],${footerContents}`; + return `{"value":${dataContents},${footerContents}`; }); };