training_data/apps/server/src/auth/auth.router.ts

21 lines
589 B
TypeScript
Raw Normal View History

2024-12-30 08:26:40 +08:00
import { Injectable } from '@nestjs/common';
import { TrpcService } from '@server/trpc/trpc.service';
2024-12-31 15:57:32 +08:00
import { AuthSchema } from '@nicestack/common';
2024-12-30 08:26:40 +08:00
import { AuthService } from './auth.service';
@Injectable()
export class AuthRouter {
constructor(
private readonly trpc: TrpcService,
private readonly authService: AuthService,
) { }
router = this.trpc.router({
signUp: this.trpc.procedure
.input(AuthSchema.signUpRequest)
.mutation(async ({ input }) => {
const result = await this.authService.signUp(input);
return result;
}),
});
}