Skip to content

Commit

Permalink
fix(pagination): only check if strings are empty so they are not seri…
Browse files Browse the repository at this point in the history
…alized as an empty qp
  • Loading branch information
velrest committed Jun 30, 2020
1 parent a75074c commit d79e0a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addon/controllers/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export default class PaginationController extends Controller {

@action
updateQueryParam(field, value) {
this.router.transitionTo({ queryParams: { [field]: value || null } });
// We dont want to set an empty stirng as this is still serialized
if (typeof value === "string" && !value.length) {
value = null;
}

this.router.transitionTo({ queryParams: { [field]: value } });
}
}

0 comments on commit d79e0a4

Please sign in to comment.