Skip to content

Commit 18f580c

Browse files
steve-chavezsoedirgo
authored andcommitted
fix: detection of maybeSingle
On PostgREST 11.2.0, the format of the error got changed on PostgREST/postgrest#2876 to "The result contains 0 rows". Change the detection to "0 rows". This should be backwards compatible.
1 parent 7b0a696 commit 18f580c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PostgrestBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export default abstract class PostgrestBuilder<Result>
149149
}
150150
}
151151

152-
if (error && this.isMaybeSingle && error?.details?.includes('Results contain 0 rows')) {
152+
if (error && this.isMaybeSingle && error?.details?.includes('0 rows')) {
153153
error = null
154154
status = 200
155155
statusText = 'OK'

0 commit comments

Comments
 (0)