#NEWLINE# @ main . route ( '/edit' , methods = [ 'POST' ] ) #NEWLINE# @ login_required #NEWLINE# def editTodo( ) : #NEWLINE# #INDENT# id = request . json [ 'id' ] #NEWLINE# task_input = request . json [ 'task' ] #NEWLINE# ( task , hashtags ) = parse_todo ( task_input ) #NEWLINE# current_user . todo . filter_by ( id = id ) . first ( ) . editTodo ( task , hashtags ) . save ( ) #NEWLINE# db . session . commit ( ) #NEWLINE# resp = { #NEWLINE# #INDENT# 'url' : url_for ( 'main.profile' ) , #NEWLINE# 'task' : task , #NEWLINE# 'hashtags' : hashtags , #NEWLINE# #UNINDENT# } #NEWLINE# return jsonify ( resp )