Refactor brand service and related components
- Removed ListQuestionVersions method and associated types from BrandService and Queries. - Updated PromptRuleGenerationService to change task naming and handling. - Enhanced ScheduleTaskService to support filtering by created date range and keyword. - Introduced InstantTaskService for managing instant tasks with appropriate filtering and response structures. - Added InstantTaskHandler for handling API requests related to instant tasks. - Created InstantTaskTab component for the admin web interface to display and manage instant tasks. - Updated database migrations to rename source types for articles and generation tasks. - Adjusted models and repository queries to reflect the removal of question version handling.
This commit is contained in:
@@ -11,6 +11,8 @@ import type {
|
||||
CompetitorRequest,
|
||||
GenerateFromRuleRequest,
|
||||
GenerateFromRuleResponse,
|
||||
InstantTaskListParams,
|
||||
InstantTaskListResponse,
|
||||
JsonValue,
|
||||
Keyword,
|
||||
KeywordRequest,
|
||||
@@ -27,7 +29,6 @@ import type {
|
||||
QuotaSummary,
|
||||
Question,
|
||||
QuestionRequest,
|
||||
QuestionVersion,
|
||||
RecentArticle,
|
||||
RefreshResponse,
|
||||
ScheduleTask,
|
||||
@@ -319,9 +320,6 @@ export const brandsApi = {
|
||||
removeQuestion(brandId: number, questionId: number) {
|
||||
return apiClient.remove<null>(`/api/tenant/brands/${brandId}/questions/${questionId}`);
|
||||
},
|
||||
listQuestionVersions(brandId: number) {
|
||||
return apiClient.get<QuestionVersion[]>(`/api/tenant/brands/${brandId}/question-versions`);
|
||||
},
|
||||
listCompetitors(brandId: number) {
|
||||
return apiClient.get<Competitor[]>(`/api/tenant/brands/${brandId}/competitors`);
|
||||
},
|
||||
@@ -408,6 +406,12 @@ export const generateApi = {
|
||||
},
|
||||
};
|
||||
|
||||
export const instantTasksApi = {
|
||||
list(params?: InstantTaskListParams) {
|
||||
return apiClient.get<InstantTaskListResponse>("/api/tenant/instant-tasks", { params });
|
||||
},
|
||||
};
|
||||
|
||||
export function normalizeInputParams(
|
||||
payload: Record<string, JsonValue>,
|
||||
articleId?: number,
|
||||
|
||||
Reference in New Issue
Block a user