Browse Source

fixed the local filter option in api

kc-covid19-zipcode
prasket 2 months ago
parent
commit
02d2606570
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      api.py

+ 6
- 6
api.py View File

@@ -79,14 +79,14 @@ def api_zipcode_all():
# json result need to figure this out.
return jsonify(rows)

@app.route('/v1/kingcounty/covid-19/zipcode/', methods=['GET'])
@app.route('/v1/kingcounty/covid-19/zipcode', methods=['GET'])
def api_zipcode():
# Check to see if 'zipcode' was provided in URL
# If no zipcode display message stating this
if 'zipcode' in request.args:
provided_zipcode = request.args['zipcode']
# Check to see if 'zip' was provided in URL
# If no zip display message stating this
if 'zip' in request.args:
provided_zipcode = request.args['zip']
else:
return "Error: No zipcode field provided. Please specify an zipcode."
return "Error: No zipcode [zip] field provided. Please specify an zipcode."

# Create an empty list for our results
results = []


Loading…
Cancel
Save