© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•14mo ago•
4 replies
Bardia

What is wrong ?!

async delete(id: string) {
    const { data, error } = await this.supabaseClient
      .from('brand')
      .delete()
      .eq('brand_id', id);

    if (error || !data) {
      console.log(data);
      throw new NotFoundException('Brand not found or delete failed');
    }

    return data || { message: 'Brand deleted successfully' };
  }
async delete(id: string) {
    const { data, error } = await this.supabaseClient
      .from('brand')
      .delete()
      .eq('brand_id', id);

    if (error || !data) {
      console.log(data);
      throw new NotFoundException('Brand not found or delete failed');
    }

    return data || { message: 'Brand deleted successfully' };
  }


this is my code for deleting brand; when i call it the data is gone ( i mean the functionality is ok and the row is deleted in DB) but i get exception in the code i wrote: Brand not found or delete failed

i don't understand
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

What is wrong with my RPC function?
SupabaseSSupabase / help-and-questions
4y ago
Wrong cardinality is inferred
SupabaseSSupabase / help-and-questions
4y ago
Failed to run SQL Query, what is wrong with my function?
SupabaseSSupabase / help-and-questions
4y ago
RLS disabled on VIEW, what could go wrong
SupabaseSSupabase / help-and-questions
3mo ago