3864d120fb
Wire alert history items-per-page to the API and parse fire_at ISO strings to datetime so single-shot push schedules save instead of 500.
834 B
834 B
2026-06-08 调度单次执行保存 500 修复
摘要
修复新建「文件推送 + 单次执行」调度保存失败(HTTP 500):fire_at ISO 字符串未转为 datetime 写入 ORM。
动机
默认 run_mode=once;前端提交 fire_at 为 toISOString() 字符串,SQLAlchemy DateTime 列拒绝字符串导致插入失败。循环模式 fire_at=null 不受影响。
变更
server/api/schema_path_validators.py:新增coerce_optional_iso_datetimeserver/api/schemas.py:ScheduleCreate/ScheduleUpdate的fire_at校验并解析为datetimetests/integration/test_schedules.py:补充 once 推送创建用例
验证
.venv/bin/pytest tests/integration/test_schedules.py -q
生产:POST /api/schedules/(run_mode=once + source_path)应返回 201。