diff --git a/app/game-api/src/router/vote/index.ts b/app/game-api/src/router/vote/index.ts index 0eb358af..b52cf230 100644 --- a/app/game-api/src/router/vote/index.ts +++ b/app/game-api/src/router/vote/index.ts @@ -416,7 +416,6 @@ export const voteRouter = router({ ) .mutation(async ({ ctx, input }) => { const general = await getMyGeneral(ctx); - const openerName = ctx.auth?.user.username ?? general.name; const options = normalizeOptions(input.options); if (options.length === 0) { throw new TRPCError({ code: 'BAD_REQUEST', message: '항목이 없습니다.' }); @@ -468,7 +467,7 @@ export const voteRouter = router({ ${multipleOptions}, ${input.revealMode}, ${general.id}, - ${openerName}, + ${general.name}, ${gameTime.now}, ${gameTime.tick === null ? null : BigInt(gameTime.tick)}, ${endAt}, diff --git a/app/game-api/test/voteRouter.test.ts b/app/game-api/test/voteRouter.test.ts index a55ce09c..b169e63f 100644 --- a/app/game-api/test/voteRouter.test.ts +++ b/app/game-api/test/voteRouter.test.ts @@ -264,7 +264,7 @@ describe('vote router actor and permission boundaries', () => { expect(fixture.redisPublish).not.toHaveBeenCalled(); }); - it('publishes a global front-status projection after creating a survey', async () => { + it('stores the authenticated general name and publishes a global projection after creating a survey', async () => { const auth = buildAuth(['admin.survey.open']); auth.user.username = 'admin-account'; auth.user.displayName = '관리자 표시명'; @@ -285,8 +285,9 @@ describe('vote router actor and permission boundaries', () => { const insert = fixture.queryRaw.mock.calls .map(([query]) => query) .find((query) => sqlText(query).includes('INSERT INTO vote_poll')); - expect(insert?.values).toContain('admin-account'); - expect(insert?.values).not.toContain('관리자 장수'); + expect(insert?.values).toContain('관리자 장수'); + expect(insert?.values).not.toContain('admin-account'); + expect(insert?.values).not.toContain('관리자 표시명'); }); it('reports the current world develcost as the legacy five-times survey reward', async () => {