cell_phone not required
This commit is contained in:
parent
12744ea98e
commit
34eb644940
@ -57,7 +57,7 @@
|
||||
"file-type-checker": "^1.0.8",
|
||||
"fp-ts": "^2.16.1",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.105",
|
||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.106",
|
||||
"module-alias": "^2.2.2",
|
||||
"monocle-ts": "^2.3.13",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
|
@ -35,7 +35,7 @@ export default class AuthController extends ApiController {
|
||||
return;
|
||||
}
|
||||
this.httpSuccess(response, {
|
||||
partialPhoneNumber: res.customer.contact?.cell_phone_number.replace(/\s/g, "").slice(-4),
|
||||
partialPhoneNumber: res.customer.contact?.cell_phone_number?.replace(/\s/g, "").slice(-4),
|
||||
totpCodeUid: res.totpCode.uid,
|
||||
});
|
||||
} catch (error) {
|
||||
@ -58,7 +58,7 @@ export default class AuthController extends ApiController {
|
||||
this.httpNotFoundRequest(response, "Customer not found");
|
||||
return;
|
||||
}
|
||||
this.httpSuccess(response, { partialPhoneNumber: customer.contact?.cell_phone_number.replace(/\s/g, "").slice(-4) });
|
||||
this.httpSuccess(response, { partialPhoneNumber: customer.contact?.cell_phone_number?.replace(/\s/g, "").slice(-4) });
|
||||
} catch (error) {
|
||||
if (error instanceof SmsNotExpiredError) {
|
||||
this.httpTooEarlyRequest(response, error.message);
|
||||
@ -229,7 +229,7 @@ export default class AuthController extends ApiController {
|
||||
return;
|
||||
}
|
||||
this.httpSuccess(response, {
|
||||
partialPhoneNumber: res.customer.contact?.cell_phone_number.replace(/\s/g, "").slice(-4),
|
||||
partialPhoneNumber: res.customer.contact?.cell_phone_number?.replace(/\s/g, "").slice(-4),
|
||||
totpCodeUid: res.totpCode.uid,
|
||||
});
|
||||
} catch (error) {
|
||||
|
@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "contacts" ALTER COLUMN "cell_phone_number" DROP NOT NULL;
|
@ -37,7 +37,7 @@ model Contacts {
|
||||
last_name String @db.VarChar(255)
|
||||
email String @db.VarChar(255)
|
||||
phone_number String? @db.VarChar(50)
|
||||
cell_phone_number String @db.VarChar(50)
|
||||
cell_phone_number String? @db.VarChar(50)
|
||||
civility ECivility @default(MALE)
|
||||
address Addresses? @relation(fields: [address_uid], references: [uid], onDelete: Cascade)
|
||||
address_uid String? @unique @db.VarChar(255)
|
||||
|
@ -56,7 +56,7 @@ export default class UsersRepository extends BaseRepository {
|
||||
last_name: user.contact!.last_name,
|
||||
email: user.contact!.email,
|
||||
phone_number: user.contact?.phone_number,
|
||||
cell_phone_number: user.contact!.cell_phone_number,
|
||||
cell_phone_number: user.contact!.cell_phone_number || null,
|
||||
civility: ECivility[user.contact?.civility as keyof typeof ECivility],
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user