fix(bot): use duration_minutes instead of duration_seconds when creating steps

- API expects duration_minutes field, not duration_seconds
- Fixed in both create_with_steps and add_steps actions
This commit is contained in:
2026-02-16 06:16:02 -06:00
parent 20f995119c
commit 1621141e76

View File

@@ -115,8 +115,7 @@ async def handle_routine(message, session, parsed):
for i, step_name in enumerate(steps): for i, step_name in enumerate(steps):
step_data = { step_data = {
"name": step_name, "name": step_name,
"description": "", "duration_minutes": None # API expects minutes, not seconds
"duration_seconds": None
} }
resp, status = api_request("post", f"/api/routines/{routine_id}/steps", token, step_data) resp, status = api_request("post", f"/api/routines/{routine_id}/steps", token, step_data)
if status == 201: if status == 201:
@@ -530,8 +529,7 @@ async def _create_routine_with_steps(message, token, name, description, steps):
for i, step_name in enumerate(steps): for i, step_name in enumerate(steps):
step_data = { step_data = {
"name": step_name, "name": step_name,
"description": "", "duration_minutes": None # API expects minutes, not seconds
"duration_seconds": None
} }
step_resp, step_status = api_request("post", f"/api/routines/{routine_id}/steps", token, step_data) step_resp, step_status = api_request("post", f"/api/routines/{routine_id}/steps", token, step_data)
if step_status == 201: if step_status == 201: