Skip to content

Commit

Permalink
fix: explain() always returning an error
Browse files Browse the repository at this point in the history
It sends `for="application/json"` as media type by default, instead of `for="undefined"`.
  • Loading branch information
laurenceisla authored and steve-chavez committed Nov 18, 2023
1 parent 3816371 commit 5e7dbdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PostgrestTransformBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export default class PostgrestTransformBuilder<
.filter(Boolean)
.join('|')
// An Accept header can carry multiple media types but postgrest-js always sends one
const forMediatype = this.headers['Accept']
const forMediatype = this.headers['Accept'] ?? 'application/json'
this.headers[
'Accept'
] = `application/vnd.pgrst.plan+${format}; for="${forMediatype}"; options=${options};`
Expand Down

0 comments on commit 5e7dbdc

Please sign in to comment.