Skip to content

Commit 8582d70

Browse files
committed
update getAdminCommentsByApplicantRecordId to use correct reviewedApplicantRecordId/applicantRecordId
1 parent 8ddbc7f commit 8582d70

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

backend/typescript/services/implementations/adminCommentService.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ class AdminCommentService implements IAdminCommentService {
3131
let adminCommentDTOs: Array<AdminCommentDTO> = [];
3232
try {
3333
adminComments = await AdminComment.findAll({
34-
where: { reviewedApplicantRecordId },
35-
});
36-
adminCommentDTOs = await adminComments.map((adminComment) => {
37-
return {
38-
id: adminComment.id;
39-
userId: adminComment.userId;
40-
applicantRecordId: adminComment.applicantRecordId;
41-
comment: adminComment.comment;
42-
createdAt: adminComment.createdAt;
43-
updatedAt: adminComment.updatedAt;
44-
};
34+
where: { applicantRecordId: reviewedApplicantRecordId },
4535
});
36+
adminCommentDTOs = adminComments.map((adminComment) => ({
37+
id: adminComment.id,
38+
userId: adminComment.userId,
39+
applicantRecordId: adminComment.applicantRecordId,
40+
comment: adminComment.comment,
41+
createdAt: adminComment.createdAt.toISOString(),
42+
updatedAt: adminComment.updatedAt.toISOString(),
43+
}));
4644
} catch (error: unknown) {
4745
Logger.error(
4846
`Failed to get admin comments by reviewedApplicantRecordId = ${reviewedApplicantRecordId}. Reason = ${getErrorMessage(

backend/typescript/services/interfaces/adminCommentService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { AdminCommentDTO, CreateAdminCommentDTO } from "../../types";
22

33
interface IAdminCommentService {
4+
getAdminCommentsByApplicantRecordId(reviewedApplicantRecordId: string): Promise<AdminCommentDTO[]>;
5+
getAdminCommentById(id: string): Promise<AdminCommentDTO>;
46
createAdminComment(content: CreateAdminCommentDTO): Promise<AdminCommentDTO>;
57
updateAdminComment(
68
commentId: string,

0 commit comments

Comments
 (0)