imprerove no content

This commit is contained in:
vincent 2019-04-25 20:26:49 +02:00
parent 3e884ea39b
commit 28e3b949e6
2 changed files with 8 additions and 4 deletions

View File

@ -15,11 +15,15 @@ def ping_pong():
@app.route('/api/v1/chaine/<num>', methods=['GET']) @app.route('/api/v1/chaine/<num>', methods=['GET'])
def get_chaine(num): def get_chaine(num):
return jsonify(data.get_chaine(num)) chaine=data.get_chaine(num)
if (chaine == "numero de chaine inconnue"):
return make_response("",204)
else:
return jsonify(chaine)
@app.route('/api/v1/chaine/', methods=['put']) @app.route('/api/v1/chaine/', methods=['put'])
def update_list(): def update_list():
status="data.parsechaine()" status=data.parsechaine()
if(status=='ok'): if(status=='ok'):
return jsonify("OK") return jsonify("OK")
else: else:
@ -29,7 +33,7 @@ def update_list():
def get_emmission(num): def get_emmission(num):
chaine=data.get_chaine(num) chaine=data.get_chaine(num)
if (chaine == "numero de chaine inconnue"): if (chaine == "numero de chaine inconnue"):
return jsonify(chaine) return make_response("",204)
else: else:
return jsonify(emission.parse_emmission(chaine)) return jsonify(emission.parse_emmission(chaine))