forked from Yara724/api
YARA-718
This commit is contained in:
@@ -70,7 +70,7 @@ export class ActorAuthService {
|
||||
res = await this.damageExpertDbService.findOne({ email: username });
|
||||
break;
|
||||
case RoleEnum.COMPANY:
|
||||
res = await this.insurerExpertDbService.findOne({ email: username });
|
||||
res = await this.insurerExpertDbService.findOne({ username });
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
@@ -153,6 +153,11 @@ export class ActorAuthService {
|
||||
clientKey: body.clientKey,
|
||||
firstName: body.firstName,
|
||||
lastName: body.lastName,
|
||||
phone: body.phone,
|
||||
mobile:body.mobile,
|
||||
city: body.city,
|
||||
state: body.state,
|
||||
address: body.address,
|
||||
};
|
||||
|
||||
return new RegisterDtoRs(
|
||||
@@ -332,6 +337,15 @@ export class ActorAuthService {
|
||||
"avatarUrl",
|
||||
"address",
|
||||
],
|
||||
company: [
|
||||
"firstName",
|
||||
"lastName",
|
||||
"phone",
|
||||
"mobile",
|
||||
"city",
|
||||
"state",
|
||||
"address",
|
||||
]
|
||||
};
|
||||
|
||||
const allowedFields = allowedFieldsByRole[role];
|
||||
@@ -384,6 +398,13 @@ export class ActorAuthService {
|
||||
);
|
||||
break;
|
||||
|
||||
case "company":
|
||||
await this.insurerExpertDbService.updateOne(
|
||||
{ _id: new Types.ObjectId(userId) },
|
||||
{ $set: sanitized },
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new ForbiddenException("Unsupported role for update");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user