Open mkbryla opened 3 years ago
it could be solved by use
return `${id ?? ''}?${Object.entries(config).map(([key, value]) => `${key}=${value}`).join('&')}`
it could be solved by use
return `${id ?? ''}?${Object.entries(config).map(([key, value]) => `${key}=${value}`).join('&')}`
+ alphabetically sort of keys to make sure, that it's always the same ~Marcin
Describe the bug Currently when fetching for example b2b user list, there is an entity added to the store with serialized query as a key. Unfortunately resposible for this is an util (so it can't be overrided)
serializeSearchConfig
and it has hardcoded returned params (pageSize, currentPage and sort only), which makes it unable to use with custom queryParams - for example when we change only the our new custom param the query will be the same (as hardcoded params won't change) and it won't make a call to fetch new data but just take value from store.Tell us the version of Spartacus
Expected behavior Could this function for example instead having hardcoded string, just iterate through the passed searchConfig object keys and based on it create the entity name string?
Screenshots