def update_task(task_id): task = request.json if (task is not None) and ('description' in task) and ('priority' in task): text = task['description'] urgent = task['priority'] db_interaction.update_task(text, urgent, int(task_id)) return Response(status=200) abort(403)
def update_task(): # get the request body add_request = request.json # check whether a task is present in the request or not if add_request is not None and ('description' and 'urgent') in add_request: text = add_request['description'] urgent = add_request['urgent'] id = add_request['id'] # update the task db_interaction.update_task(int(id), text, urgent) return Response(status=200) # return an error in case of problems abort(403)
def update_task(task_id): # get the request body add_request = request.json # check whether a task is present in the request or not if add_request is not None and ('description' and 'urgent') in add_request: text = add_request['description'] urgent = add_request['urgent'] # update the task task = db_interaction.update_task(int(task_id),text,urgent) return Response(status=200) # return an error in case of problems abort(403)