Files
accounted/app/api/articles/[id]
Jakob Wennberg b5e3c476a5 fix(articles): article delete failed for everyone on a phantom column (#1188)
* fix(articles): article delete failed for everyone on a phantom column

Support report (odinaero.se): three unused articles could not be
deleted. Root cause: the DELETE route's usage preflight filtered
invoice_items by company_id, a column that table does not have, so
PostgREST answered 42703 and the route mapped it to
ARTICLE_DELETE_FAILED on every delete since 8a9a930f. The queued
supabase mock swallows chained filters, which is why tests stayed
green; a source-pin regression test now guards the query shape.

Tenancy is unaffected: the preceding articles lookup already scopes
the id to the company, and invoice_items rows are only reachable via
that article's UUID.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: decision log for the currency-honesty batch and the phantom-column lesson

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 13:11:02 +02:00
..