m
This commit is contained in:
parent
710f7675c3
commit
ba7976d935
10 changed files with 271 additions and 356 deletions
|
|
@ -41,7 +41,7 @@ function countQueueStatuses(statuses: string[]): QueueHealth {
|
|||
|
||||
export async function fetchDashboardSnapshot(): Promise<DashboardSnapshot> {
|
||||
const [publications, runsPayload, queueItems] = await Promise.all([
|
||||
listPublications({ mode: "new", limit: 20 }),
|
||||
listPublications({ mode: "latest", limit: 20 }),
|
||||
listRuns({ limit: 20 }),
|
||||
listQueueItems(200),
|
||||
]);
|
||||
|
|
@ -50,7 +50,7 @@ export async function fetchDashboardSnapshot(): Promise<DashboardSnapshot> {
|
|||
const queueHealth = countQueueStatuses(queueItems.map((item) => item.status));
|
||||
|
||||
return {
|
||||
newCount: publications.new_count,
|
||||
newCount: publications.latest_count,
|
||||
totalCount: publications.total_count,
|
||||
mode: publications.mode,
|
||||
latestRun: runs[0] ?? null,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { apiRequest } from "@/lib/api/client";
|
||||
|
||||
export type PublicationMode = "all" | "new";
|
||||
export type PublicationMode = "all" | "unread" | "latest";
|
||||
|
||||
export interface PublicationItem {
|
||||
publication_id: number;
|
||||
|
|
@ -19,6 +19,9 @@ export interface PublicationItem {
|
|||
export interface PublicationsResult {
|
||||
mode: PublicationMode;
|
||||
selected_scholar_profile_id: number | null;
|
||||
unread_count: number;
|
||||
latest_count: number;
|
||||
// Compatibility alias for latest_count; retained while API clients migrate.
|
||||
new_count: number;
|
||||
total_count: number;
|
||||
publications: PublicationItem[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue