Skip to content

Countries API - add "type" to response (minor thing) and ideally as param #759

@nanometrenat

Description

@nanometrenat

Hi

Really sorry, I should've thought of this when logging #671

At the moment when records are returned via https://goadmin.ifrc.org/api/v2/country/ we have no way of knowing whether the record is a Country or a Cluster or a Region or a Country Office etc. - this is in the dropdown on Django admin but not returned via the API. At the moment we do a manual filter process in the country export but ideally we would just be able to filter by the Record type.

So, if you could please

  1. return Record Type in the country API response (think here?? https://github.com/IFRCGo/go-api/blob/master/api/serializers.py#L51), and
  2. (if not too hard/risky) please also add Record Type as a parameter in the request https://goadmin.ifrc.org/docs/#country-list
  3. when we move FDRS codes from being hardcoded to being stored in the db (therefore maintained via Django admin) then these will need to be added to the response also Remove hard-coded values and database ids from frontend code go-frontend#940 (comment)
  4. While there, I have another question - what does the "search" param actually search, currently? I can't get it to change the output in any way at all... it would be great if the search param searched at least country name, society name and the isos... if poss? Or add as separate params if preferred?

Again, #1 above is the most important, and the only thing that would be great to have in the short term please.

THANKS

image
xref IFRCGo/go-frontend#938

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions