update

parent 7a06930d
......@@ -3,6 +3,7 @@ import { RequestHandler } from "express";
import { plainToInstance } from 'class-transformer';
// import { SignInUserDto } from "@/dto/sign-in-user.dto";
import { RegistrationUserDto } from "@/dto/registration-user.dto";
import { SignInUserDto } from "@/dto/sign-in-user.dto";
export class UserController {
private service: UserService;
......@@ -12,14 +13,13 @@ export class UserController {
}
signIn: RequestHandler = async (req, res): Promise<void> => {
res.send(req.headers.authorization)
// try {
// const signInDto = plainToInstance(SignInUserDto, req.body)
// const user = await this.service.signIn(signInDto)
// res.send(user)
// } catch (e) {
// res.status(401).send((e as Error).message)
// }
try {
const signInDto = plainToInstance(SignInUserDto, req.body)
const user = await this.service.signIn(signInDto)
res.send(user)
} catch (e) {
res.status(401).send((e as Error).message)
}
}
registration: RequestHandler = async (req, res): Promise<void> => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment