Add pay action to form

This commit is contained in:
2026-06-15 19:10:56 -04:00
parent 2146fa6bad
commit 369c8b872e
2 changed files with 16 additions and 1 deletions

8
app.py
View File

@@ -157,6 +157,12 @@ def index():
"out",
client_timestamp
)
elif action == "pay":
# Update the paid column for all entries for the selected user to True
create_entry(
selected_user_id,
"pay"
)
elif action == "report":
begin_date = request.form.get("begin_date")
end_date = request.form.get("end_date")
@@ -219,7 +225,7 @@ def api_create_entry():
entry_type = data.get("entrytype")
client_timestamp = data.get("timestamp")
paid = data.get("paid", False)
if entry_type not in ("in", "out"):
if entry_type not in ("in", "out", "pay"):
return jsonify({
"error": "Invalid entrytype"
}), 400