Implementato DELETE compito
This commit is contained in:
1 parent
d37f2af737
commit
16d4194836
1 file changed
+8
@@ -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