CodeForAfrica / HealthTools.API

HealthTools API to retrieve, structure and return data being used by the health tools. Accessible at https://api.healthtools.codeforafrica.org/
https://api.healthtools.codeforafrica.org/
MIT License
19 stars 20 forks source link

Remove "Nonetype" error when doc_type is not provided #60

Closed TinaMurimi closed 6 years ago

TinaMurimi commented 6 years ago

What does this PR do?

If a doc_type is not provided or an unknown doc_type is provided, an error is raised because doc_type==None. This PR corrects this error.

DavidLemayian commented 6 years ago

I think the easiest fix to this would be to check here and return some failed status.

Bonus points: If you get it to work with this.

Also healthtools/manage.py → manage.py.. No.

TinaMurimi commented 6 years ago

Ok. Will work on that.

TinaMurimi commented 6 years ago

@DavidLemayian If we check if the query is passed at base_api, we will miss out on returning all results for the doc_type.

DavidLemayian commented 6 years ago

@tinamorale I thought about it and search endpoint should return a null/fail for missing parameter/argument. If we'd like to return all results for the doc_type, it would be a different end-point.