modify checkbox text in notes
This commit is contained in:
@@ -174,6 +174,20 @@ def create_app():
|
||||
user_db.session.commit()
|
||||
return _note_redirect(note.id)
|
||||
|
||||
@app.route(
|
||||
"/notes/<int:note_id>/items/<int:item_id>", methods=["POST"]
|
||||
)
|
||||
@login_required
|
||||
def notes_update_item(note_id, item_id):
|
||||
note = _note_or_404(note_id)
|
||||
item = NoteItem.query.filter_by(id=item_id, note_id=note.id).first_or_404()
|
||||
text = request.form.get("text", "").strip()
|
||||
if text:
|
||||
item.text = text[:255]
|
||||
note.touch()
|
||||
user_db.session.commit()
|
||||
return _note_redirect(note.id)
|
||||
|
||||
@app.route(
|
||||
"/notes/<int:note_id>/items/<int:item_id>/toggle", methods=["POST"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user