From 0bf0b3de5172437379c1fd87bed954866d67dcf7 Mon Sep 17 00:00:00 2001 From: muhammedsirajudeen Date: Sun, 23 Feb 2025 19:55:08 +0530 Subject: [PATCH] refactor: - Introduced constants in refactor - Removed unwanted comment from user.model.ts --- .../implementation/auth.controller.ts | 4 ++-- backend/src/models/implementation/user.model.ts | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/backend/src/controllers/implementation/auth.controller.ts b/backend/src/controllers/implementation/auth.controller.ts index 0e01cf3..7efed11 100644 --- a/backend/src/controllers/implementation/auth.controller.ts +++ b/backend/src/controllers/implementation/auth.controller.ts @@ -10,7 +10,7 @@ export class AuthController implements IAuthController { try { const user = await this._authService.signup(req.body); - res.status(200).json({ + res.status(HttpStatus.OK).json({ email: user, }); } catch (err) { @@ -31,7 +31,7 @@ export class AuthController implements IAuthController { sameSite: "strict", }); - res.status(200).json({ accessToken: tokens.accessToken }); + res.status(HttpStatus.OK).json({ accessToken: tokens.accessToken }); } catch (err) { next(err); } diff --git a/backend/src/models/implementation/user.model.ts b/backend/src/models/implementation/user.model.ts index 7ee3618..27c5d52 100644 --- a/backend/src/models/implementation/user.model.ts +++ b/backend/src/models/implementation/user.model.ts @@ -1,23 +1,6 @@ import { model, Schema, Document } from "mongoose"; import { IUser } from "shared/types"; -// interface IUser { -// _id: string; -// username: string; -// name: string; -// email: string; -// password: string; -// status: "active" | "blocked"; -// role: "user" | "moderator"; -// bio: string; -// profile_picture?: string; -// social_links: { type: string; url: string }[]; -// resume?: string; -// date_of_birth: Date; -// created_at: Date; -// updated_at: Date; -// } - export interface IUserModel extends Document, Omit {} const userSchema = new Schema(