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:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user