Skip to content

Commit

Permalink
fix: use null if return=minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Feb 6, 2023
1 parent f8edc51 commit 860387e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/PostgrestQueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class PostgrestQueryBuilder<
}: {
count?: 'exact' | 'planned' | 'estimated'
} = {}
): PostgrestFilterBuilder<Schema, Relation['Row'], undefined> {
): PostgrestFilterBuilder<Schema, Relation['Row'], null> {
const method = 'POST'

const prefersHeaders = []
Expand Down Expand Up @@ -150,7 +150,7 @@ export default class PostgrestQueryBuilder<
body,
fetch: this.fetch,
allowEmpty: false,
} as unknown as PostgrestBuilder<undefined>)
} as unknown as PostgrestBuilder<null>)
}

/**
Expand Down Expand Up @@ -197,7 +197,7 @@ export default class PostgrestQueryBuilder<
ignoreDuplicates?: boolean
count?: 'exact' | 'planned' | 'estimated'
} = {}
): PostgrestFilterBuilder<Schema, Relation['Row'], undefined> {
): PostgrestFilterBuilder<Schema, Relation['Row'], null> {
const method = 'POST'

const prefersHeaders = [`resolution=${ignoreDuplicates ? 'ignore' : 'merge'}-duplicates`]
Expand All @@ -220,7 +220,7 @@ export default class PostgrestQueryBuilder<
body,
fetch: this.fetch,
allowEmpty: false,
} as unknown as PostgrestBuilder<undefined>)
} as unknown as PostgrestBuilder<null>)
}

/**
Expand Down Expand Up @@ -251,7 +251,7 @@ export default class PostgrestQueryBuilder<
}: {
count?: 'exact' | 'planned' | 'estimated'
} = {}
): PostgrestFilterBuilder<Schema, Relation['Row'], undefined> {
): PostgrestFilterBuilder<Schema, Relation['Row'], null> {
const method = 'PATCH'
const prefersHeaders = []
const body = values
Expand All @@ -271,7 +271,7 @@ export default class PostgrestQueryBuilder<
body,
fetch: this.fetch,
allowEmpty: false,
} as unknown as PostgrestBuilder<undefined>)
} as unknown as PostgrestBuilder<null>)
}

/**
Expand All @@ -297,7 +297,7 @@ export default class PostgrestQueryBuilder<
count,
}: {
count?: 'exact' | 'planned' | 'estimated'
} = {}): PostgrestFilterBuilder<Schema, Relation['Row'], undefined> {
} = {}): PostgrestFilterBuilder<Schema, Relation['Row'], null> {
const method = 'DELETE'
const prefersHeaders = []
if (count) {
Expand All @@ -315,6 +315,6 @@ export default class PostgrestQueryBuilder<
schema: this.schema,
fetch: this.fetch,
allowEmpty: false,
} as unknown as PostgrestBuilder<undefined>)
} as unknown as PostgrestBuilder<null>)
}
}

0 comments on commit 860387e

Please sign in to comment.