forked from Yara724/api
Added registrar mirrored
This commit is contained in:
@@ -6536,6 +6536,28 @@ export class ClaimRequestManagementService {
|
||||
},
|
||||
{ lean: true },
|
||||
);
|
||||
} else if (actor?.role === RoleEnum.REGISTRAR) {
|
||||
const registrarBlameIds = await this.blameRequestDbService
|
||||
.find(
|
||||
{
|
||||
registrarInitiated: true,
|
||||
creationMethod: "IN_PERSON",
|
||||
initiatedByRegistrarId: new Types.ObjectId(currentUserId),
|
||||
},
|
||||
{ select: "_id", lean: true },
|
||||
)
|
||||
.then((docs) => docs.map((d) => (d as any)._id));
|
||||
claims = await this.claimCaseDbService.find(
|
||||
{
|
||||
$or: [
|
||||
{ "owner.userId": new Types.ObjectId(currentUserId) },
|
||||
...(registrarBlameIds.length
|
||||
? [{ blameRequestId: { $in: registrarBlameIds } }]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
{ lean: true },
|
||||
);
|
||||
} else {
|
||||
claims = await this.claimCaseDbService.find(
|
||||
{ "owner.userId": new Types.ObjectId(currentUserId) },
|
||||
|
||||
Reference in New Issue
Block a user