fix(miniprogram): submitRecord 补充 task_id 字段 — 后端 CreateFollowUpRecordReq 必填
Some checks failed
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled

后端 CreateFollowUpRecordReq 要求 body 中包含 task_id 字段,
小程序端 followup.ts 和 doctor.ts 的 submitRecord/createFollowUpRecord
均未传递 task_id,导致 422 Unprocessable Entity。
This commit is contained in:
iven
2026-04-28 00:16:21 +08:00
parent 83162817ce
commit fbb28e655d
2 changed files with 2 additions and 1 deletions

View File

@@ -203,7 +203,7 @@ export async function createFollowUpRecord(taskId: string, data: {
medical_advice?: string;
next_follow_up_date?: string;
}) {
return api.post<FollowUpRecord>(`/health/follow-up-tasks/${taskId}/records`, data);
return api.post<FollowUpRecord>(`/health/follow-up-tasks/${taskId}/records`, { task_id: taskId, ...data });
}
export async function listFollowUpRecords(params?: { task_id?: string; page?: number }) {

View File

@@ -43,6 +43,7 @@ export async function submitRecord(taskId: string, data: {
next_follow_up_date?: string;
}) {
return api.post<FollowUpRecord>(`/health/follow-up-tasks/${taskId}/records`, {
task_id: taskId,
...data,
executed_date: new Date().toISOString().slice(0, 10),
});