We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b88bc5 commit a3073d0Copy full SHA for a3073d0
src/routes/user/user.controller.ts
@@ -59,6 +59,18 @@ export class UsersController extends Controller {
59
return usernames;
60
}
61
62
+ @Get('/twitch/{twitchId}')
63
+ public async getUsernameForTwitchId(
64
+ @Path() twitchId: number,
65
+ @Res() notFound: TsoaResponse<404, { message: string }>,
66
+ ): Promise<string | {message: string}> {
67
+ const [user] = await db.select({username: users.name}).from(users).where(eq(users.twitchId, twitchId)).limit(1);
68
+ if(!user) throw new Error("twitchId not found");
69
+ return user.username;
70
+ }
71
+
72
73
74
@Post('{username}/characters/update')
75
public async requestUpdateNowForUser(
76
@Path() username: string,
0 commit comments