From f15eaea9ff6a2fc03b7741ff1d1ab4a6741f4941 Mon Sep 17 00:00:00 2001 From: Devin Zuczek Date: Mon, 13 Jul 2026 17:50:25 -0400 Subject: [PATCH] fix custom avatar item flag --- apps/api/src/routes/avatar.ts | 9 ++++++--- apps/api/src/test/integration/api.test.ts | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/api/src/routes/avatar.ts b/apps/api/src/routes/avatar.ts index aa6e8be..2cae650 100644 --- a/apps/api/src/routes/avatar.ts +++ b/apps/api/src/routes/avatar.ts @@ -99,9 +99,12 @@ export const avatarRoutes = new Hono({ strict: false }) }) // Custom avatar item gates — real Rec Room client endpoints with no backing - // implementation yet. Each returns a bare JSON boolean; we enable them. Flip - // to `false` to disable the corresponding flow. - .get('/api/customAvatarItems/v1/isCreationAllowedForAccount', (c) => c.json(true)) + // implementation yet; we enable them. Flip to `false` to disable the + // corresponding flow. `isCreationAllowedForAccount` wraps its answer in the + // success/value envelope; the other two return a bare JSON boolean. + .get('/api/customAvatarItems/v1/isCreationAllowedForAccount', (c) => + c.json({ success: true, value: null }) + ) .get('/api/customAvatarItems/v1/isCreationEnabled', (c) => c.json(true)) .get('/api/customAvatarItems/v1/isRenderingEnabled', (c) => c.json(true)) diff --git a/apps/api/src/test/integration/api.test.ts b/apps/api/src/test/integration/api.test.ts index ab6589f..4f78283 100644 --- a/apps/api/src/test/integration/api.test.ts +++ b/apps/api/src/test/integration/api.test.ts @@ -290,12 +290,12 @@ describe('public endpoints', () => { expect(await res.json()).toEqual([]) }) - test('GET /api/customAvatarItems/v1/isCreationAllowedForAccount returns true', async () => { + test('GET /api/customAvatarItems/v1/isCreationAllowedForAccount returns a success envelope', async () => { const res = await exports.default.fetch( `${ORIGIN}/api/customAvatarItems/v1/isCreationAllowedForAccount` ) expect(res.status).toBe(200) - expect(await res.json()).toBe(true) + expect(await res.json()).toEqual({ success: true, value: null }) }) test('GET /api/customAvatarItems/v1/isCreationEnabled returns true', async () => {