From 650c04ef671b28161b410bd354039e98cb8895d3 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 21 Apr 2023 16:02:58 +0100 Subject: [PATCH] Fix missing flatten --- assets/js/editor-components/utils/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/editor-components/utils/index.js b/assets/js/editor-components/utils/index.js index cfa7a7621d7..4c36e9f73e0 100644 --- a/assets/js/editor-components/utils/index.js +++ b/assets/js/editor-components/utils/index.js @@ -165,7 +165,8 @@ export const getProductTags = ( { selected = [], search } ) => { return Promise.all( requests.map( ( path ) => apiFetch( { path } ) ) ).then( ( data ) => { - return uniqBy( flatten( data ), 'id' ); + const flatData = data.flat(); + return uniqBy( flatData, ( item ) => item.id ); } ); };