Skip to content

Commit

Permalink
refractor repositories file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa-lopes-pt committed Jun 22, 2024
1 parent e6d083d commit 7ece332
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/src/repositories/Auth.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import Repository from "./Repository";
import { DbUserSchemaType } from "./auth/DbUser.type";
import { DbUserSchemaType } from "./DbUser.type";

const USERS_DATABASE = "users";
const USERS_COLLECTION = "users_list";
Expand Down
3 changes: 3 additions & 0 deletions backend/src/repositories/DbUser.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { UserSchemaType } from "../../../shared/schemas/user.schema";

export type DbUserSchemaType = UserSchemaType & { password: string };
3 changes: 0 additions & 3 deletions backend/src/repositories/auth/DbUser.type.ts

This file was deleted.

2 changes: 1 addition & 1 deletion backend/src/routes/controllers/auth/login.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextFunction, Request, Response } from "express";
import { WithId } from "mongodb";
import HTTPCodes from "simple-http-codes";
import { DbUserSchemaType } from "../../../repositories/auth/DbUser.type";
import { DbUserSchemaType } from "../../../repositories/DbUser.type";
import HttpError from "../../../utils/HttpError";
import { compareHash, signToken } from "../../../utils/crypto";
import { authRepo } from "./auth.router";
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/controllers/auth/signup.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { UserSchemaType } from "../../../../../shared/schemas/user.schema";
import HttpError from "../../../utils/HttpError";
import { hashData } from "../../../utils/crypto";
import { authRepo } from "./auth.router";
import { DbUserSchemaType } from "../../../repositories/auth/DbUser.type";
import { DbUserSchemaType } from "../../../repositories/DbUser.type";

export default async function signupController(
req: Request,
Expand Down

0 comments on commit 7ece332

Please sign in to comment.