Implementato DELETE compito
This commit is contained in:
8
app.py
8
app.py
@@ -26,4 +26,12 @@ def get_compito_by_id(id):
|
||||
return jsonify(ciscomerda), 200
|
||||
return jsonify([]), 404
|
||||
|
||||
@app.route("/compiti/<int:id>", methods=["DELETE"])
|
||||
def delete_compito(id):
|
||||
for ciscomerda in compiti:
|
||||
if ciscomerda["id"] == id:
|
||||
compiti.remove(ciscomerda)
|
||||
return jsonify(ciscomerda), 200
|
||||
return jsonify([]), 404
|
||||
|
||||
app.run(debug=True)
|
||||
|
||||
Reference in New Issue
Block a user