update

parent 7a06930d
...@@ -3,6 +3,7 @@ import { RequestHandler } from "express"; ...@@ -3,6 +3,7 @@ import { RequestHandler } from "express";
import { plainToInstance } from 'class-transformer'; import { plainToInstance } from 'class-transformer';
// import { SignInUserDto } from "@/dto/sign-in-user.dto"; // import { SignInUserDto } from "@/dto/sign-in-user.dto";
import { RegistrationUserDto } from "@/dto/registration-user.dto"; import { RegistrationUserDto } from "@/dto/registration-user.dto";
import { SignInUserDto } from "@/dto/sign-in-user.dto";
export class UserController { export class UserController {
private service: UserService; private service: UserService;
...@@ -11,15 +12,14 @@ export class UserController { ...@@ -11,15 +12,14 @@ export class UserController {
this.service = new UserService(); this.service = new UserService();
} }
signIn: RequestHandler = async (req, res): Promise<void> => { signIn: RequestHandler = async (req, res): Promise<void> => {
res.send(req.headers.authorization) try {
// try { const signInDto = plainToInstance(SignInUserDto, req.body)
// const signInDto = plainToInstance(SignInUserDto, req.body) const user = await this.service.signIn(signInDto)
// const user = await this.service.signIn(signInDto) res.send(user)
// res.send(user) } catch (e) {
// } catch (e) { res.status(401).send((e as Error).message)
// res.status(401).send((e as Error).message) }
// }
} }
registration: RequestHandler = async (req, res): Promise<void> => { 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