Skip to content

Commit

Permalink
Merge pull request #283 from supabase/BREAK/omit-nullsfirst-nullslast…
Browse files Browse the repository at this point in the history
…-by-default

feat: omit `.nullsfirst`/`.nullslast` by default
  • Loading branch information
soedirgo authored Jun 17, 2022
2 parents ae2726b + a1012e8 commit 36dfa2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PostgrestTransformBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class PostgrestTransformBuilder<
column: string,
{
ascending = true,
nullsFirst = true,
nullsFirst,
foreignTable,
}: { ascending?: boolean; nullsFirst?: boolean; foreignTable?: string } = {}
): this {
Expand All @@ -69,8 +69,8 @@ export default class PostgrestTransformBuilder<

this.url.searchParams.set(
key,
`${existingOrder ? `${existingOrder},` : ''}${column}.${ascending ? 'asc' : 'desc'}.${
nullsFirst ? 'nullsfirst' : 'nullslast'
`${existingOrder ? `${existingOrder},` : ''}${column}.${ascending ? 'asc' : 'desc'}${
nullsFirst === undefined ? '' : nullsFirst ? '.nullsfirst' : '.nullslast'
}`
)
return this
Expand Down

0 comments on commit 36dfa2f

Please sign in to comment.