forked from wangziqi/gongxue-base
feat: resolve public bank conflicts
This commit is contained in:
@@ -85,6 +85,26 @@ export interface PublicQuestionBankItem {
|
||||
adoption?: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export interface PublicQuestionBankConflictItem {
|
||||
sourceQuestionId?: string;
|
||||
targetQuestionId?: string | null;
|
||||
action?: string;
|
||||
sourceHash?: string;
|
||||
previousSourceHash?: string | null;
|
||||
targetHash?: string | null;
|
||||
}
|
||||
|
||||
export interface PublicQuestionBankConflictsResult {
|
||||
adoptionId?: string;
|
||||
syncStatus?: string;
|
||||
status?: string;
|
||||
lastSyncedAt?: string | null;
|
||||
updatedAt?: string;
|
||||
conflictCount?: number;
|
||||
counts?: Record<string, unknown>;
|
||||
conflicts?: PublicQuestionBankConflictItem[];
|
||||
}
|
||||
|
||||
export interface ImportIssueItem {
|
||||
id: string;
|
||||
rowNo?: number | null;
|
||||
@@ -250,11 +270,18 @@ export async function syncPublicQuestionBank(input: { adoptionId: string; copyLi
|
||||
}
|
||||
|
||||
export async function loadPublicQuestionBankConflicts(adoptionId: string) {
|
||||
return apiRequest<{ item?: Record<string, unknown> }>('/api/tenant-content/public-question-banks/conflicts', {
|
||||
return apiRequest<{ item?: PublicQuestionBankConflictsResult }>('/api/tenant-content/public-question-banks/conflicts', {
|
||||
query: { adoptionId },
|
||||
});
|
||||
}
|
||||
|
||||
export async function resolvePublicQuestionBankConflict(input: { adoptionId: string; sourceQuestionId: string; resolution: 'accept_platform' | 'keep_local' }) {
|
||||
return apiRequest<{ item?: Record<string, unknown> }>('/api/tenant-content/public-question-banks/conflicts/resolve', {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
|
||||
export async function runImportPostCheck(jobId: string) {
|
||||
return apiRequest<{ item?: Record<string, unknown> }>('/api/tenant-content/imports/post-check', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user