21 lines
589 B
TypeScript
Executable File
21 lines
589 B
TypeScript
Executable File
import { Injectable } from '@nestjs/common';
|
|
import { TrpcService } from '@server/trpc/trpc.service';
|
|
import { AuthSchema } from '@nicestack/common';
|
|
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;
|
|
}),
|
|
});
|
|
}
|