From d485219c6849d0c8d7627e51e1f5cca6c5154586 Mon Sep 17 00:00:00 2001 From: isra el Date: Mon, 2 Dec 2024 08:56:04 +0300 Subject: [PATCH] fix(api): fix phone no not getting saved during signup --- api/src/users/schemas/user.schema.ts | 2 +- api/src/users/users.service.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/users/schemas/user.schema.ts b/api/src/users/schemas/user.schema.ts index a0642e7..56d9ee4 100644 --- a/api/src/users/schemas/user.schema.ts +++ b/api/src/users/schemas/user.schema.ts @@ -21,7 +21,7 @@ export class User { avatar?: string @Prop({ type: String, trim: true }) - phone: string + phone?: string @Prop({ type: String }) password: string diff --git a/api/src/users/users.service.ts b/api/src/users/users.service.ts index 44cd71d..12c2e00 100644 --- a/api/src/users/users.service.ts +++ b/api/src/users/users.service.ts @@ -19,10 +19,12 @@ export class UsersService { name, email, password, + phone, }: { name: string email: string password?: string + phone?: string }) { if (await this.findOne({ email })) { throw new HttpException( @@ -37,6 +39,7 @@ export class UsersService { name, email, password, + phone, }) return await newUser.save() }