From c5ac3ba5677f2a8c41a69a23f621cc88b18db120 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Mon, 13 Jul 2026 06:30:00 +0800 Subject: [PATCH] fix(api): add tdpAvg to estFps type in buildPluginGameResponse args --- apps/web/lib/api/__tests__/plugin-public.test.ts | 2 +- apps/web/lib/api/plugin-public.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/lib/api/__tests__/plugin-public.test.ts b/apps/web/lib/api/__tests__/plugin-public.test.ts index afd9415..c7012e2 100644 --- a/apps/web/lib/api/__tests__/plugin-public.test.ts +++ b/apps/web/lib/api/__tests__/plugin-public.test.ts @@ -93,7 +93,7 @@ describe("buildPluginGameResponse — shape contract", () => { const r = await buildPluginGameResponse({ game: { id: "g1", steamAppId: 123, title: "X", slug: "x" }, entries, recent: entries, - estFps: { avg: 72.3, low: 35, onePct: 38, high: 140, count: 25 }, + estFps: { avg: 72.3, low: 35, onePct: 38, high: 140, count: 25, tdpAvg: 13.5 }, }) expect(r.estFps).not.toBeNull() expect(r.estFps!.avg).toBe(72.3) diff --git a/apps/web/lib/api/plugin-public.ts b/apps/web/lib/api/plugin-public.ts index cb601a2..f977023 100644 --- a/apps/web/lib/api/plugin-public.ts +++ b/apps/web/lib/api/plugin-public.ts @@ -71,7 +71,7 @@ export async function buildPluginGameResponse(args: { game: PluginGameRow | null entries?: PluginEntryRow[] recent?: PluginEntryRow[] - estFps?: { avg: number; low: number | null; onePct: number | null; high: number | null; count: number } | null + estFps?: { avg: number; low: number | null; onePct: number | null; high: number | null; count: number; tdpAvg: number | null } | null }): Promise { if (!args.game) { return { game: null, estFps: null, topEntries: [], recentEntries: [] }