From 89a8015e70c1ef440983efe2b9bde410fe1a9400 Mon Sep 17 00:00:00 2001 From: didoslavov Date: Mon, 25 Mar 2024 05:05:39 +0200 Subject: [PATCH] change avatar column to img --- server/src/components/User/User.model.ts | 2 +- server/src/components/User/auth.controller.ts | 4 +++- server/src/components/User/user.interface.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/components/User/User.model.ts b/server/src/components/User/User.model.ts index 5ba8f05..44cb2c7 100644 --- a/server/src/components/User/User.model.ts +++ b/server/src/components/User/User.model.ts @@ -25,7 +25,7 @@ class User extends Model { declare email: string; @Column({ type: DataType.STRING, allowNull: true }) - declare avatar: string | undefined; + declare img: string | undefined; @Column({ type: DataType.STRING, allowNull: false }) declare password: string; diff --git a/server/src/components/User/auth.controller.ts b/server/src/components/User/auth.controller.ts index 92d3e40..1001dca 100644 --- a/server/src/components/User/auth.controller.ts +++ b/server/src/components/User/auth.controller.ts @@ -20,6 +20,8 @@ const register = expressAsyncHandler(async (req: Request, res: Response): Promis throw new AppError(409, 'User already exist!'); } + console.log(userData); + const user = await createUser(userData); if (!user) { @@ -55,7 +57,7 @@ const login = expressAsyncHandler(async (req: Request, res: Response): Promise