Hi, how can I use two filters in delete with js? I...
# off-topic
h
Hi, how can I use two filters in delete with js? I want delete items equal to uuid and not equal to default. ex. eq('uuid',item.uuid).neq('default',true) it's not working for me :/
k
What kind of "not working"? The types suggest it should work
(did you put .execute() at the end? That's a little trap in the API)
h
When I use the double filter nothing happens. In the log for data from delete I gets an empty array and no error. When i use single filter all it's ok
No i dont use .execute
Copy code
await supabase.from('Cards').delete().eq('uuid', this.warranty.uuid);
      console.log(this.warranty.templateID);
      try {
        const { data, error } = await supabase
          .from('Templates')
          .delete()
          .eq('uuid', this.warranty.templateID)
          .neq('default',true)
          if(error) throw error
          console.log(data);
      } catch (error) {
        console.log(error);
      }
Cards has realtionship to Templates
uuid it's ok, default has only one card
k
oh wait, it seems .execute() is a Python thing and you're in JS
is there an RLS on Templates?
h
yes, execute not working
Yes
k
would it allow selecting the row you want to delete?
h
I think so because it works for a single filter
k
I'm guessing at this stage, but https://supabase.com/docs/reference/javascript/delete#notes says it's important 🙂
h
yes
k
then I'm lost, I'd at least expect an error if a matching template exists.
g
backing out my comment as ktosiek's solution resolved issue.
h
Works! 😂
Thank you
match works for me
k
and my advice would be sound, if not for those pesky NULLs! (this comment made sense until garyaustin changed his)
😄