Closed katamartin closed 10 months ago
i believe we currently support all three behaviors above
(1) returns those that are enrolled in compliance programs
❯ http 'https://offsets-db-staging.fly.dev/projects/?per_page=1&is_compliance=true'
{
"data": [
{
"category": [
"industrial-gases"
],
"clips": [],
"country": "United States",
"is_compliance": true,
"issued": 307729,
"listed_at": null,
"name": "ECC ODS Destruction 2012",
"project_id": "ACR170",
"project_url": "https://acr2.apx.com/mymodule/reg/prjView.asp?id1=170",
"proponent": "None",
"protocol": [
"arb-ozone"
],
"registry": "american-carbon-registry",
"retired": 0,
"status": "completed"
}
],
"pagination": {
"current_page": 1,
"next_page": "http://offsets-db-staging.fly.dev/projects/?per_page=1&is_compliance=true¤t_page=2",
"total_entries": 632,
"total_pages": 632
}
}
(2): is_compliance=false
those that are not enrolled in compliance programs
❯ http 'https://offsets-db-staging.fly.dev/projects/?per_page=1&is_compliance=false'
{
"data": [
{
"category": [
"renewable-energy"
],
"clips": [],
"country": "Mali",
"is_compliance": false,
"issued": 0,
"listed_at": null,
"name": "AFOVERT Energy",
"project_id": "ACR101",
"project_url": "https://acr2.apx.com/mymodule/reg/prjView.asp?id1=101",
"proponent": "None",
"protocol": [
"ams-i-e"
],
"registry": "american-carbon-registry",
"retired": 0,
"status": "canceled"
}
],
"pagination": {
"current_page": 1,
"next_page": "http://offsets-db-staging.fly.dev/projects/?per_page=1&is_compliance=false¤t_page=2",
"total_entries": 8935,
"total_pages": 8935
}
}
(3) returns all projects
❯ http 'https://offsets-db-staging.fly.dev/projects/?per_page=1'
{
"data": [
{
"category": [
"renewable-energy"
],
"clips": [],
"country": "Mali",
"is_compliance": false,
"issued": 0,
"listed_at": null,
"name": "AFOVERT Energy",
"project_id": "ACR101",
"project_url": "https://acr2.apx.com/mymodule/reg/prjView.asp?id1=101",
"proponent": "None",
"protocol": [
"ams-i-e"
],
"registry": "american-carbon-registry",
"retired": 0,
"status": "canceled"
}
],
"pagination": {
"current_page": 1,
"next_page": "http://offsets-db-staging.fly.dev/projects/?per_page=1¤t_page=2",
"total_entries": 9567,
"total_pages": 9567
}
}
Sorry for the false flag! Seeing the same thing now with https://github.com/carbonplan/offsets-db-web/commit/ea903ca75dc8a6e4029c89c5f30b2382410e726f
It would be useful filter projects down to lists of:
is_compliance=true
is_compliance
flag?)In order to accomplish this, I think we could either rework the behavior of
is_compliance
so thatis_compliance=false
and omitting the param do distinct things (2 and 3 above, respectively) or come up with another parameter interface -- open to either!