feat: paginate and search brand questions across selects
Make GET /api/tenant/brands/:id/questions return a paginated QuestionListResponse (items/total/page/page_size) with optional `q` full-text filter, validated page/page_size query params, and per-params cache keys. Add a usePaginatedBrandQuestions composable backing the imitation, template-wizard, and tracking question selects with search-as-you-type and infinite scroll, plus ensure-loaded-by-id so a deep-linked or pre-selected question is fetched even when off the first page. Brands view now drives its questions table via server pagination. Also redesign the Tracking hot-questions and cited-articles lists (mention-rate badges/bars, metric groups, refreshed styling) and fall back to citation-fact article_id/title when no high-confidence URL alias matches, so cited articles surface even without an alias row. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,7 @@ import type {
|
||||
QuestionCombinationFillResult,
|
||||
QuestionCombinationRequest,
|
||||
QuestionDistillRequest,
|
||||
QuestionListResponse,
|
||||
QuestionRequest,
|
||||
QuotaSummary,
|
||||
RecentArticle,
|
||||
@@ -1139,9 +1140,12 @@ export const brandsApi = {
|
||||
removeKeyword(brandId: number, keywordId: number) {
|
||||
return apiClient.remove<null>(`/api/tenant/brands/${brandId}/keywords/${keywordId}`)
|
||||
},
|
||||
listQuestions(brandId: number, keywordId?: number | null) {
|
||||
return apiClient.get<Question[]>(`/api/tenant/brands/${brandId}/questions`, {
|
||||
params: keywordId ? { keyword_id: keywordId } : undefined,
|
||||
listQuestions(
|
||||
brandId: number,
|
||||
params?: { keyword_id?: number | null; page?: number; page_size?: number; q?: string },
|
||||
) {
|
||||
return apiClient.get<QuestionListResponse>(`/api/tenant/brands/${brandId}/questions`, {
|
||||
params,
|
||||
})
|
||||
},
|
||||
previewQuestionCombination(brandId: number, payload: QuestionCombinationRequest) {
|
||||
|
||||
Reference in New Issue
Block a user