supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
965 stars 129 forks source link

statusText returns as empty string #404

Closed pfeffer629 closed 1 year ago

pfeffer629 commented 1 year ago

Bug report

Describe the bug

I have tested upsert and insert, and upon success, receive this response:

{error: null, data: null, count: null, status: 201, statusText: ''}

I am trying to use statusText to determine whether a row has been created or updated.

To Reproduce

  async function createUser() {
    const res = await supabase
      .from("users")
      .insert(
        { username: username },
      );

    if (res.error) {
      throw res.error;
    }
    console.log(res)
  }

Expected behavior

statusText returns information as per documentation

Screen Shot 2023-02-22 at 10 56 38 AM

System information

soedirgo commented 1 year ago

Closing as duplicate of #405