From 369c8b872e9d5ab00e0a70a185e8a979b542e75f Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Mon, 15 Jun 2026 19:10:56 -0400 Subject: [PATCH] Add pay action to form --- app.py | 8 +++++++- templates/index.html | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 9c526fe..8e7360d 100644 --- a/app.py +++ b/app.py @@ -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 diff --git a/templates/index.html b/templates/index.html index 9527c31..9d4c0b9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -111,6 +111,15 @@ Clock Out + +