0xJohnnyboy / spider-query-builder

Builds a queryparams string for interactions with API Platform based backend
GNU Affero General Public License v3.0
2 stars 0 forks source link

Split sort params, pagination params and others in queryBuilder #9

Closed 0xJohnnyboy closed 2 years ago

0xJohnnyboy commented 2 years ago

Version

3.0.0 and prior

Issue

This would be interesting to split these 3 types of params, as oftentimes you want to update pageIndex, but not the filters, nor the sorting.

Suggestion

const qb = new SpdrQueryBuilder()

qb.params.{whatever filter}()
qb.sort.{whatever sort}()
qb.pagination.{whatever pagination}()

With clearing methods like

qb.sort.clear()

qb.params.search('username', ['johnny'])
qb.params.remove('username')

This way we would be able to update the pagination without the rest and vice versa

0xJohnnyboy commented 2 years ago

Closing this issue, feature available in v3.1.0 See #10 changelog.