DistributedProofreaders / dproofreaders

Distributed Proofreaders is a web application intended to ease the process of converting public domain books into e-texts.
https://www.pgdp.net
GNU General Public License v2.0
47 stars 28 forks source link

api/v1/projects: Fix project search bug, improve error reporting #1182

Closed bpfoley closed 5 months ago

bpfoley commented 5 months ago

c9fc66620 introduced error reporting if the user requests to render a project field that doesn't exist, eg with api/v1/projects?field[]=no_such_field. The refactoring to do this accidentally left the queryable attribute off the state field (and only that field!), and we had no error reporting to warn the user they were searching on unqueryable fields, so, eg, api/v1/projects?state=P3.proj_avail would silently ignore the state query term and would return all projects.

  1. Make state work again. (Should there be a hat for this?)
  2. Add error reporting on unrecognized query keys, eg api/v1/projects?eligible_for_bulwer_lytton=yes, which would have exposed this.