From b87df796f38aca85544d3e6df31e04f7b58a132b Mon Sep 17 00:00:00 2001 From: Devin Zuczek Date: Sun, 12 Jul 2026 23:54:05 -0400 Subject: [PATCH] add tagfilters --- apps/api/src/routes/gameplay.ts | 10 +++++++++- apps/api/src/test/integration/api.test.ts | 11 +++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/api/src/routes/gameplay.ts b/apps/api/src/routes/gameplay.ts index 55ced1b..d4f1c81 100644 --- a/apps/api/src/routes/gameplay.ts +++ b/apps/api/src/routes/gameplay.ts @@ -21,10 +21,18 @@ export const gameplayRoutes = new Hono({ strict: false }) .get('/api/keepsakes/categories', (c) => c.json([])) // ---- Objectives / events / rewards --------------------------------------- - .post('/api/objectives/v1/updateobjective', (c) => c.body(null, 200)) + // Objectives live on the `econ` host (`updateobjective` / `myprogress`), which is + // where the client calls them — they are not served here. .get('/api/communityboard/v2/current', (c) => c.json({})) // TODO: hydrate from JSON/communityboard.json .get('/api/playerevents/v1/all', (c) => c.json({ Created: [], Responses: [] })) + // The tag filter chips on the player-events browse screen. Derived from the tags in + // use across events — we store no events, so there are no chips to offer. + // `TrendingFilters` is null even in the reference (it needs recent-activity data). + .get('/api/playerevents/v1/tagfilters', (c) => + c.json({ PinnedFilters: [], PopularFilters: [], TrendingFilters: null }) + ) + // Player events for a set of clubs (`?id=1&id=2`) — the events shelf on a club's // page. A bare array: the client deserializes this one as a list, and chokes on the // `{ ContinuationToken, Events }` envelope the single-club form uses. No diff --git a/apps/api/src/test/integration/api.test.ts b/apps/api/src/test/integration/api.test.ts index 0b6d4e9..8fb83cb 100644 --- a/apps/api/src/test/integration/api.test.ts +++ b/apps/api/src/test/integration/api.test.ts @@ -179,6 +179,17 @@ describe('public endpoints', () => { expect(reps.map((r) => r.AccountId)).toEqual([1, 2]) }) + test('GET /api/playerevents/v1/tagfilters returns empty filter chips', async () => { + // No player-event storage → no tags in use → no chips. Trending is null. + const res = await exports.default.fetch(`${ORIGIN}/api/playerevents/v1/tagfilters`) + expect(res.status).toBe(200) + expect(await res.json()).toEqual({ + PinnedFilters: [], + PopularFilters: [], + TrendingFilters: null, + }) + }) + test('GET /api/playerevents/v1/clubs returns an empty event list', async () => { // The client deserializes this as a bare array — an envelope here fails with // "expected:'[', actual:'{'". No player-event storage yet → empty.