Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Conversation

psteinroe
Copy link
Contributor

@psteinroe psteinroe commented May 31, 2022

What kind of change does this PR introduce?

Bug Fix

closes #271

What is the current behavior?

Currently, throwOnError() throws if empty results are received despite maybeSingle(). See #271 for details.

What is the new behavior?

const { data, error } = await supabaseClient
  .from('channel')
  .update({ active: false })
  .eq('id', channelId)
  .throwOnError(true)
  .maybeSingle(); 
console.error(error) // null, and no error is thrown

@soedirgo
Copy link
Member

This is a pretty clean solution, thanks!

@soedirgo soedirgo merged commit b303b52 into supabase:master May 31, 2022
@github-actions
Copy link

🎉 This PR is included in version 0.37.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

leohku pushed a commit to leohku/postgrest-js that referenced this pull request Jul 13, 2023
* fix: make throwOnError work with maybeSingle

* fix: pass allowEmpty in constructor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

throwOnError does not respect maybeSingle

2 participants