Skip to content

Commit

Permalink
GeoNode#1551: Sort param serializer fix (GeoNode#1552) (GeoNode#1567)
Browse files Browse the repository at this point in the history
(cherry picked from commit 181ad4f)
  • Loading branch information
dsuren1 authored and chumano committed Apr 25, 2024
1 parent 925950e commit bb58fb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geonode_mapstore_client/client/js/utils/APIUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ export const getApiToken = () => {
* @returns {Object} updated params
*/
export const paramsSerializer = (params) => {
const {include, exclude, ...rest} = params ?? {}; // Update bracket params (if any)
const {include, exclude, sort, ...rest} = params ?? {}; // Update bracket params (if any)
let queryParams = '';
if (!isEmpty(include) || !isEmpty(exclude)) {
queryParams = queryString.stringify({include, exclude}, { arrayFormat: 'bracket'});
if (!isEmpty(include) || !isEmpty(exclude) || !isEmpty(sort)) {
queryParams = queryString.stringify({include, exclude, sort}, { arrayFormat: 'bracket'});
}
if (!isEmpty(rest)) {
queryParams = (isEmpty(queryParams) ? '' : `${queryParams}&`) + queryString.stringify(rest);
Expand Down

0 comments on commit bb58fb8

Please sign in to comment.