Add new categories/envelopes from the Budget page and the loader's categorize card
build-container / build (push) Successful in 35s
build-container / build (push) Successful in 35s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
690316e541
commit
5068021b09
4 files changed
+33
-1
No files matched your search
@@ -172,6 +172,12 @@ class H(BaseHTTPRequestHandler):
|
||||
req = json.loads(body or b"{}")
|
||||
with LOCK: out = L.set_budget(req["month"], req["budgets"])
|
||||
return self._send(200, {"message": f"Saved the {req['month']} budget ({out['rows']} envelopes). Backup: {out['backup']}."})
|
||||
if u.path == "/api/add_category":
|
||||
try:
|
||||
with LOCK: out = L.add_category(json.loads(body or b"{}").get("name"))
|
||||
except ValueError as e: return self._send(400, {"error": str(e)})
|
||||
note = " It will show on the web pages; the Excel summary tabs only have 20 category slots." if out["beyond_excel"] else ""
|
||||
return self._send(200, {"message": f"Added category '{out['name']}'.{note} Backup: {out['backup']}.", "name": out["name"]})
|
||||
if u.path == "/api/set_categories":
|
||||
with LOCK: out = L.set_categories(json.loads(body or b"[]"))
|
||||
return self._send(200, {"message": f"Updated {out['updated']} payee(s). Backup: {out['backup']}."})
|
||||
|
||||
Reference in new issue
Block a user