Skip to content

Commit

Permalink
Revert "Update getTermsInfo() to workaround parsing issue for transla…
Browse files Browse the repository at this point in the history
…table strings (#33341)"

This reverts commit daf7814.
  • Loading branch information
ocean90 authored Jul 12, 2021
1 parent e7566c7 commit 13773a7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/block-library/src/query/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ import { store as coreStore } from '@wordpress/core-data';
* @param {WPTerm[]} terms The terms to extract of helper object.
* @return {QueryTermsInfo} The object with the terms information.
*/
export const getTermsInfo = ( terms ) => {
const mapping = terms?.reduce(
export const getTermsInfo = ( terms ) => ( {
terms,
...terms?.reduce(
( accumulator, term ) => {
const { mapById, mapByName, names } = accumulator;
mapById[ term.id ] = term;
Expand All @@ -49,13 +50,8 @@ export const getTermsInfo = ( terms ) => {
return accumulator;
},
{ mapById: {}, mapByName: {}, names: [] }
);

return {
terms,
...mapping,
};
};
),
} );

/**
* Returns a helper object that contains:
Expand Down

0 comments on commit 13773a7

Please sign in to comment.