手动同步改为异步任务并前端轮询状态

This commit is contained in:
2026-07-04 12:10:33 +08:00
parent ab14eb9c30
commit 46013a2b2f
4 changed files with 98 additions and 23 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ export interface SyncJob {
records_count: number
started_at: string
finished_at?: string
error_message: string
error_message?: string
trigger_by: string
}
@@ -147,5 +147,5 @@ export const api = {
stockSyncStatus: () => request<SyncJob | null>('/api/stocks/sync/status'),
triggerStockSync: () =>
request<{ records_count: number }>('/api/admin/stocks/sync', { method: 'POST' }),
request<{ job: SyncJob }>('/api/admin/stocks/sync', { method: 'POST' }),
}