carbonplan / offsets-db-api

accounting of voluntary and compliance offset programs
https://carbonplan.org/research/offsets-db
MIT License
1 stars 0 forks source link

temporary hard code `per_page` for `/clips/` endpoint #91

Closed andersy005 closed 8 months ago

andersy005 commented 8 months ago

our database setup involves tables with one-to-many and many-to-many relationships. we need to correctly count the total number of distinct entries that match the query criteria across these related tables. our current implementation relies on the per_page limit and offset query params to filter out the data. however, the way these two parameters are used seem to be incompatible with the assumptions made in handle_pagination() helper function.

the problem becomes evident when working with /clips endpoint which requires joining clip, clipproject and project tables. the pagination is not accurately reflecting the total count of distinct entries, leading to discrepancies in the total pages and entries reported versus the actual data fetched.

andersy005 commented 8 months ago

fixing this issue turned to be more involved than i anticipated. and i decided to put it on the back burner while temporary hard coding the per_page to a large number (300). i'll address this at a later time.