Skip to content

Commit 74ce44a

Browse files
author
William Yang
committed
fix: adapt sync script to new unified API response format
1 parent 9708921 commit 74ce44a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/sync-to-api.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ async function main() {
104104
process.exit(1);
105105
}
106106

107-
const result = await response.json();
107+
const responseData = await response.json();
108+
// API 返回统一格式 { success: true, data: {...} }
109+
const result = responseData.data || responseData;
110+
108111
console.log("\n✅ Sync successful!");
109112
console.log(` Course: ${result.course?.action || "unknown"}`);
110113
console.log(` Stages: created=${result.stages?.created || 0}, updated=${result.stages?.updated || 0}`);

0 commit comments

Comments
 (0)