fix(miniprogram): submitRecord 补充 task_id 字段 — 后端 CreateFollowUpRecordReq 必填
后端 CreateFollowUpRecordReq 要求 body 中包含 task_id 字段, 小程序端 followup.ts 和 doctor.ts 的 submitRecord/createFollowUpRecord 均未传递 task_id,导致 422 Unprocessable Entity。
This commit is contained in:
@@ -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 }) {
|
||||
|
||||
@@ -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),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user