pemiluAPI / geographic-api-endpoint

The Geographic API is a service that provides information about geographic boundaries relevant to Indonesian elections and civic government.
http://docs.geographicapi.apiary.io/
0 stars 0 forks source link

empty candidate lists from geographic endpoint should have same format as empty candidate lists from candidates endpoint #2

Open tmaybe opened 10 years ago

tmaybe commented 10 years ago

An empty result from a call to the geographic/caleg endpoint should have "count", "total" and "caleg" parameters, the same way an empty call to the candidates/caleg endpoint does.

_Example_:

http://api.pemiluapi.org/geographic/api/caleg?apiKey=fea6f7d9ec0b31e256a673114792cb17&lat=37.7591135&long=-122.40828269999997

returns

{
  "data": {
    "results": []
  }
}

and it should return:

{
  "data": {
    "results": {
      "count": 0,
      "total": 0,
      "caleg": []
    }
  }
}

The way an empty list from the candidates endpoint does. See: http://api.pemiluapi.org/candidate/api/caleg?apiKey=fea6f7d9ec0b31e256a673114792cb17&nama=apodaca

williamn commented 10 years ago

@tmaybe we have deployed the fixes to staging. Please kindly check it.