Skip to content

Commit e5b3611

Browse files
committed
feat/added their label for connections to show in verification table
Signed-off-by: Sujit <[email protected]>
1 parent 8557feb commit e5b3611

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

apps/verification/src/repositories/verification.repository.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class VerificationRepository {
8787
proofRequestsSearchCriteria: IProofRequestSearchCriteria
8888
): Promise<IProofPresentationsListCount> {
8989
try {
90-
const proofRequestsList = await this.prisma.presentations.findMany({
90+
const proofRequestsListData = await this.prisma.presentations.findMany({
9191
where: {
9292
orgId,
9393
OR: [
@@ -115,6 +115,23 @@ export class VerificationRepository {
115115
take: Number(proofRequestsSearchCriteria.pageSize),
116116
skip: (proofRequestsSearchCriteria.pageNumber - 1) * proofRequestsSearchCriteria.pageSize
117117
});
118+
119+
const proofRequestsList = await Promise.all(
120+
proofRequestsListData.map(async (presentation) => {
121+
if (!presentation.connectionId) {
122+
return { ...presentation, theirLabel: null };
123+
}
124+
const connection = await this.prisma.connections.findUnique({
125+
where: { connectionId: presentation.connectionId },
126+
select: { theirLabel: true }
127+
});
128+
return {
129+
...presentation,
130+
theirLabel: connection?.theirLabel ?? null
131+
};
132+
})
133+
);
134+
118135
const proofRequestsCount = await this.prisma.presentations.count({
119136
where: {
120137
orgId,

0 commit comments

Comments
 (0)