modify checkbox text in notes

This commit is contained in:
2026-11-01 20:04:33 +01:00
parent 7675acd81e
commit e55af30644
7 changed files with 77 additions and 8 deletions
+14
View File
@@ -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"]
)