https://supabase.com/ logo
#help
Title
# help
p

Prodigy7kX

04/19/2022, 9:05 PM
Hey all, I have this pretty simple query:
Copy code
ts
async function deleteOneAccount(id: string) {
  const { data: account, error } = await supabase
    .from<Account>('accounts')
    .delete()
    .match({ id })
    .throwOnError();

  return { account, error };
}
The query is executed just fine but always throws back a warning:
Copy code
json
{
  "details": "Results contain 0 rows, application/vnd.pgrst.object+json requires 1 row",
  "message": "JSON object requested, multiple (or no) rows returned",
}
Can anyone explain why it does happen?
n

Needle

04/19/2022, 9:05 PM
Hello @Prodigy7kX! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
m

Muezz

04/19/2022, 9:13 PM
My assumption is that there is no row with that id. Try printing that id to the log and match it to a row visually if there arent too many rows.
n

Needle

04/19/2022, 9:13 PM
Prodigy7kX (2022-04-19)
g

garyaustin

04/19/2022, 9:38 PM
.match() requires an object with {col:value} format at a minimum
p

Prodigy7kX

04/19/2022, 9:42 PM
oh yeah, I know, Im just using short hand assignment
my column name is id and the param i'm getting is also id