running now
This commit is contained in:
parent
85cd083750
commit
c17bb05f0a
25 changed files with 156 additions and 114 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import { Router } from "express";
|
||||
import { AuthController } from "../controllers/AuthController";
|
||||
import { UserRepository } from "../repositories/UserRepository";
|
||||
import { UserDtoEntityMapper } from "../mappers/UserDtoEntityMapper";
|
||||
import { AuthController } from "../controllers/AuthController.js";
|
||||
import { UserRepository } from "../repositories/UserRepository.js";
|
||||
import { UserDtoEntityMapper } from "../mappers/UserDtoEntityMapper.js";
|
||||
import {
|
||||
ValidationError,
|
||||
UnauthorizedError,
|
||||
InternalServerError,
|
||||
} from "../errors/httpErrors";
|
||||
import { LoginRequestDto } from "../dtos/LoginRequestDto";
|
||||
} from "../errors/httpErrors.js";
|
||||
import { LoginRequestDto } from "../dtos/LoginRequestDto.js";
|
||||
|
||||
const router = Router();
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ const authController = new AuthController(userRepository, mapper);
|
|||
router.post("/login", async (req, res) => {
|
||||
try {
|
||||
const requestDto: LoginRequestDto = req.body;
|
||||
const responseDto = await authController.login(requestDto));
|
||||
const responseDto = await authController.login(requestDto);
|
||||
res.json(responseDto);
|
||||
} catch (err: any) {
|
||||
if (err instanceof ValidationError || err instanceof UnauthorizedError) {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { Router } from "express";
|
||||
import { UserController } from "../controllers/UserController";
|
||||
import { CreateUserRequestDto } from "../dtos/CreateUserRequestDto";
|
||||
import { UserRepository } from "../repositories/UserRepository";
|
||||
import { UserDtoEntityMapper } from "../mappers/UserDtoEntityMapper";
|
||||
import { UserController } from "../controllers/UserController.js";
|
||||
import { CreateUserRequestDto } from "../dtos/CreateUserRequestDto.js";
|
||||
import { UserRepository } from "../repositories/UserRepository.js";
|
||||
import { UserDtoEntityMapper } from "../mappers/UserDtoEntityMapper.js";
|
||||
import {
|
||||
ValidationError,
|
||||
ConflictError,
|
||||
NotFoundError,
|
||||
InternalServerError,
|
||||
} from "../errors/httpErrors";
|
||||
} from "../errors/httpErrors.js";
|
||||
|
||||
const router = Router();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue