MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / deleteTask

Function deleteTask

src/astroprint/api/additionaltasks.py:35–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33@api.route("/additional-tasks", methods=["DELETE"])
34@restricted_access
35def deleteTask():
36 data = request.json
37 tId = data.get('id', None)
38
39 if tId:
40 atm = additionalTasksManager()
41 r = atm.removeTask(tId)
42
43 if 'error' in r:
44 error = r['error']
45
46 if error == 'not_found':
47 return make_response('Not Found', 404)
48 else:
49 return make_response(error, 500)
50
51 else:
52 return jsonify(r)
53
54 return make_response('Invalid Request', 400)
55
56@api.route("/additional-tasks/install", methods=["POST"])
57@restricted_access

Callers

nothing calls this directly

Calls 3

additionalTasksManagerFunction · 0.90
removeTaskMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected