Skip to content

Commit

Permalink
fix: asc orderings direction should not be included in query
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed May 10, 2021
1 parent f8dcee9 commit 46431fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/buildQueryURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ type ValidParamName =
const castOrderingToString = (ordering: Ordering | string): string =>
typeof ordering === 'string'
? ordering
: [ordering.field, ordering.direction].filter(Boolean).join(' ')
: [
ordering.field,
ordering.direction === 'desc' ? ordering.direction : undefined,
]
.filter(Boolean)
.join(' ')

export type BuildQueryURLArgs = QueryParams & BuildQueryURLParams

Expand Down

0 comments on commit 46431fd

Please sign in to comment.