What is wrong ?!
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
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' };
}