1 import { server } from '../../lib/server';
2 import { Static, Type } from '@sinclair/typebox';
3 import { prisma } from '../../lib/db';
4 import { ForbiddenError } from '../../lib/http-errors';
5 import {Player} from '@prisma/client';
7 const PlayerInput = Type.Object({
9 playerId: Type.String()
13 type PlayerInputType = Static<typeof PlayerInput>;
15 export const playerInfo = server.get<PlayerInputType, Player>('/v1/accounts/:playerId', {
19 const player = await prisma.player.findUnique({
21 id: req.params.playerId
26 throw new ForbiddenError('Not allowed');