test(invites): tighten requireAdmin mock to match real Fastify contract

This commit is contained in:
Jannis Braun
2026-04-28 20:40:24 +02:00
parent 0c9865ad90
commit ade5c0d998
+2 -2
View File
@@ -35,10 +35,10 @@ vi.mock('../utils/auth.js', () => ({
}, },
requireAdmin: async ( requireAdmin: async (
_req: { userId?: string }, _req: { userId?: string },
reply: { code: (n: number) => { send: (b: unknown) => void } }, reply: { code: (n: number) => { send: (b: unknown) => unknown } },
) => { ) => {
if (!callerIsAdmin) { if (!callerIsAdmin) {
reply.code(403).send({ error: 'Admin required', statusCode: 403 }); return reply.code(403).send({ error: 'Admin required', statusCode: 403 });
} }
}, },
})); }));