forked from wangziqi/gongxue-base
feat: notify tenants about public bank syncs
This commit is contained in:
@@ -218,6 +218,24 @@ export interface PublicQuestionBankConflictsResult {
|
||||
conflicts?: PublicQuestionBankConflictItem[];
|
||||
}
|
||||
|
||||
export interface TenantContentNotificationItem {
|
||||
id: string;
|
||||
notificationType?: string;
|
||||
status?: 'unread' | 'read' | 'dismissed' | 'resolved';
|
||||
severity?: 'info' | 'success' | 'warning' | 'error';
|
||||
adoptionId?: string | null;
|
||||
sourceQuestionBankId?: string | null;
|
||||
title?: string;
|
||||
message?: string;
|
||||
actionLabel?: string | null;
|
||||
actionPath?: string | null;
|
||||
metadata?: Record<string, unknown>;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
readAt?: string | null;
|
||||
resolvedAt?: string | null;
|
||||
}
|
||||
|
||||
export interface ImportIssueItem {
|
||||
id: string;
|
||||
rowNo?: number | null;
|
||||
@@ -651,6 +669,27 @@ export async function loadPublicQuestionBanks() {
|
||||
return apiRequest<{ items?: PublicQuestionBankItem[] }>('/api/tenant-content/public-question-banks');
|
||||
}
|
||||
|
||||
export async function loadTenantContentNotifications(input: {
|
||||
status?: 'unread' | 'read' | 'dismissed' | 'resolved';
|
||||
notificationType?: string;
|
||||
adoptionId?: string;
|
||||
limit?: number;
|
||||
} = {}) {
|
||||
return apiRequest<{ items?: TenantContentNotificationItem[]; summary?: Record<string, number> }>('/api/tenant-content/notifications', {
|
||||
query: input,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateTenantContentNotificationStatus(input: {
|
||||
notificationIds: string[];
|
||||
status: 'read' | 'dismissed' | 'resolved';
|
||||
}) {
|
||||
return apiRequest<{ item?: Record<string, unknown> }>('/api/tenant-content/notifications/status', {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
|
||||
export async function adoptPublicQuestionBank(input: { grantId: string; entryName?: string; collectionName?: string; copyLimit?: number }) {
|
||||
return apiRequest<{ item?: Record<string, unknown> }>('/api/tenant-content/public-question-banks/adopt', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user