SupabaseS
Supabase12mo ago
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' };
  }


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
Was this page helpful?