Browse Source

fix(api): fix phone no not getting saved during signup

pull/28/head
isra el 1 year ago
parent
commit
d485219c68
  1. 2
      api/src/users/schemas/user.schema.ts
  2. 3
      api/src/users/users.service.ts

2
api/src/users/schemas/user.schema.ts

@ -21,7 +21,7 @@ export class User {
avatar?: string avatar?: string
@Prop({ type: String, trim: true }) @Prop({ type: String, trim: true })
phone: string
phone?: string
@Prop({ type: String }) @Prop({ type: String })
password: string password: string

3
api/src/users/users.service.ts

@ -19,10 +19,12 @@ export class UsersService {
name, name,
email, email,
password, password,
phone,
}: { }: {
name: string name: string
email: string email: string
password?: string password?: string
phone?: string
}) { }) {
if (await this.findOne({ email })) { if (await this.findOne({ email })) {
throw new HttpException( throw new HttpException(
@ -37,6 +39,7 @@ export class UsersService {
name, name,
email, email,
password, password,
phone,
}) })
return await newUser.save() return await newUser.save()
} }

Loading…
Cancel
Save