feat: sync upstream keys and reorder priorities

This commit is contained in:
SmartUp Developer
2026-06-03 17:03:11 +08:00
parent a42bcba483
commit b866b387e0
8 changed files with 415 additions and 57 deletions
+12
View File
@@ -291,6 +291,16 @@ export interface ImportAccountItem {
raw: Record<string, any>
}
export interface ReorderPriorityItem {
account_id: string | null
group_id: string
upstream_id: number
old_priority: number | null
new_priority: number | null
status: string
message: string
}
export interface WebsiteBatchSyncResponse {
total: number
success: number
@@ -311,6 +321,8 @@ export const websitesApi = {
api.post<{ success: boolean; message: string; items: ImportGroupItem[] }>(`/api/websites/${id}/groups/import-from-upstream/${upstreamId}`, data),
syncImportedUpstreamKeys: (id: number, data: { upstream_id: number }) =>
api.post<{ success: boolean; message: string; items: ImportAccountItem[] }>(`/api/websites/${id}/accounts/sync-imported-upstream-keys`, data),
reorderAccountPriorities: (id: number, data: { upstream_id: number }) =>
api.post<{ success: boolean; message: string; items: ReorderPriorityItem[] }>(`/api/websites/${id}/accounts/reorder-priority`, data),
importAccountsFromUpstreamKeys: (id: number, data: {
upstream_key_ids: number[]
target_group_map: Record<string, string>