ai-coding-minesIndexGitHub

A nonexistent enum is not an error; it's 0 rows

Write APIs

Symptom

Queried with a status filter, got 0. Read it as "no items in that status."

Cause

The filter value was an enum that doesn't exist (wrote APPROVING; the real value is IN_REVIEW). No error. 200 with an empty array.

Fix

Take filter values from real data, not docs. Fetch everything once and count the distinct values of that field. Done.

Count the denominator. In 0/N, if you don't know N you don't know what 0 means.