From 725540a95bffcdbee3634443cf74a98f25a7c052 Mon Sep 17 00:00:00 2001 From: Devin Zuczek Date: Thu, 23 Jul 2026 14:28:32 -0400 Subject: [PATCH] add playerevents endpoint, whatever that is --- apps/api/src/routes/gameplay.ts | 14 ++++++++++++++ apps/api/src/test/integration/api.test.ts | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/apps/api/src/routes/gameplay.ts b/apps/api/src/routes/gameplay.ts index e38378d..d97f82a 100644 --- a/apps/api/src/routes/gameplay.ts +++ b/apps/api/src/routes/gameplay.ts @@ -194,6 +194,20 @@ export const gameplayRoutes = new Hono({ strict: false }) }), (c) => c.json({ ContinuationToken: '', Events: [] }) ) + // Live player-event search (the "happening now" browse query). No player-event + // storage yet, so there's nothing live to return — a bare empty array. + .get( + '/api/playerevents/v1/searchlive', + describeRoute({ + tags: ['Gameplay'], + summary: 'Search live player events', + description: + 'The "happening now" search on the player-events browse screen. No player-event ' + + 'storage yet, so there are no live events — returns an empty list.', + responses: { 200: json(JsonArray, 'An empty list') }, + }), + (c) => c.json([]) + ) .get( '/api/announcement/v1/get', describeRoute({ diff --git a/apps/api/src/test/integration/api.test.ts b/apps/api/src/test/integration/api.test.ts index 602bfe4..ce2adc3 100644 --- a/apps/api/src/test/integration/api.test.ts +++ b/apps/api/src/test/integration/api.test.ts @@ -219,6 +219,13 @@ describe('public endpoints', () => { expect(await one.json()).toEqual({ ContinuationToken: '', Events: [] }) }) + test('GET /api/playerevents/v1/searchlive returns an empty list', async () => { + // No player-event storage yet → nothing live to return. + const res = await exports.default.fetch(`${ORIGIN}/api/playerevents/v1/searchlive`) + expect(res.status).toBe(200) + expect(await res.json()).toEqual([]) + }) + test('GET /api/PlayerReporting/v1/moderationBlockDetails reports "not blocked"', async () => { const res = await exports.default.fetch( `${ORIGIN}/api/PlayerReporting/v1/moderationBlockDetails` @@ -1931,6 +1938,7 @@ describe('openapi', () => { 'GET /api/playerevents/v1/all', 'GET /api/playerevents/v1/club/{clubId}', 'GET /api/playerevents/v1/clubs', + 'GET /api/playerevents/v1/searchlive', 'GET /api/playerevents/v1/tagfilters', 'GET /api/players/v1/progression/{id}', 'GET /api/players/v2/progression/bulk',