Fix/transaction inconsitensies (#190)

* fix: request explicit page size from Enable Banking API to fetch all transactions

The API defaults to ~10 transactions per page when no limit is specified,
causing incomplete syncs for users with more transactions.


* fix: enhance DELETE operations and add missing RLS policies for multi-tenant support
This commit is contained in:
Mattsson
2026-04-08 11:25:46 +02:00
committed by GitHub
parent 3dd1f782c3
commit 6486e0d9e2
10 changed files with 381 additions and 45 deletions
+6 -2
View File
@@ -174,9 +174,9 @@ export async function DELETE(
const companyId = await requireCompanyId(supabase, user.id)
const { error } = await supabase
const { error, count } = await supabase
.from('customers')
.delete()
.delete({ count: 'exact' })
.eq('id', id)
.eq('company_id', companyId)
@@ -184,5 +184,9 @@ export async function DELETE(
return NextResponse.json({ error: error.message }, { status: 500 })
}
if (count === 0) {
return NextResponse.json({ error: 'Customer not found' }, { status: 404 })
}
return NextResponse.json({ success: true })
}
+6 -2
View File
@@ -141,9 +141,9 @@ export async function DELETE(
)
}
const { error } = await supabase
const { error, count: deleteCount } = await supabase
.from('suppliers')
.delete()
.delete({ count: 'exact' })
.eq('id', id)
.eq('company_id', companyId)
@@ -151,5 +151,9 @@ export async function DELETE(
return NextResponse.json({ error: error.message }, { status: 500 })
}
if (deleteCount === 0) {
return NextResponse.json({ error: 'Supplier not found' }, { status: 404 })
}
return NextResponse.json({ success: true })
}