Skip to content

Commit 4b3d6e7

Browse files
committed
run yarn fix
1 parent 69ee274 commit 4b3d6e7

File tree

4 files changed

+44
-15
lines changed

4 files changed

+44
-15
lines changed

backend/typescript/graphql/resolvers/reviewPageResolvers.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { ApplicationDTO, ReviewedApplicantRecordDTO, ReviewedApplicantsDTO } from "../../types";
1+
import {
2+
ApplicationDTO,
3+
ReviewedApplicantRecordDTO,
4+
ReviewedApplicantsDTO,
5+
} from "../../types";
26
import ReviewPageService from "../../services/implementations/reviewPageService";
37
import { getErrorMessage } from "../../utilities/errorUtils";
48

@@ -32,10 +36,13 @@ const reviewPageResolvers = {
3236
Mutation: {
3337
reportReviewConflict: async (
3438
_parent: undefined,
35-
args: { applicantRecordId: string, reviewerId: number },
39+
args: { applicantRecordId: string; reviewerId: number },
3640
): Promise<ReviewedApplicantRecordDTO> => {
3741
try {
38-
return await reviewPageService.reportReviewConflict(args.applicantRecordId, args.reviewerId);
42+
return await reviewPageService.reportReviewConflict(
43+
args.applicantRecordId,
44+
args.reviewerId,
45+
);
3946
} catch (error) {
4047
throw new Error(getErrorMessage(error));
4148
}

backend/typescript/graphql/types/reviewPageType.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ const reviewPageType = gql`
4242
}
4343
4444
extend type Mutation {
45-
reportReviewConflict(applicantRecordId: String!, reviewerId: String!): ReviewedApplicantRecordDTO!
45+
reportReviewConflict(
46+
applicantRecordId: String!
47+
reviewerId: String!
48+
): ReviewedApplicantRecordDTO!
4649
}
4750
4851
extend type Query {

backend/typescript/services/implementations/reviewPageService.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { ApplicationDTO, ReviewedApplicantRecordDTO, ReviewedApplicantsDTO } from "../../types";
1+
import {
2+
ApplicationDTO,
3+
ReviewedApplicantRecordDTO,
4+
ReviewedApplicantsDTO,
5+
} from "../../types";
26
import IReviewPageService from "../interfaces/IReviewPageService";
37
import { getErrorMessage } from "../../utilities/errorUtils";
48
import logger from "../../utilities/logger";
@@ -129,18 +133,26 @@ class ReviewPageService implements IReviewPageService {
129133
}
130134
}
131135

132-
async reportReviewConflict(applicantRecordId: string, reviewerId: number): Promise<ReviewedApplicantRecordDTO> {
136+
async reportReviewConflict(
137+
applicantRecordId: string,
138+
reviewerId: number,
139+
): Promise<ReviewedApplicantRecordDTO> {
133140
try {
134-
const reviewedApplicantRecord: ReviewedApplicantRecord | null = await ReviewedApplicantRecord.findOne({
135-
where: { applicantRecordId, reviewerId },
136-
});
137-
if (!reviewedApplicantRecord) throw new Error(`No reviewed applicant record with ${applicantRecordId} and ${reviewerId} found.`);
141+
const reviewedApplicantRecord: ReviewedApplicantRecord | null =
142+
await ReviewedApplicantRecord.findOne({
143+
where: { applicantRecordId, reviewerId },
144+
});
145+
if (!reviewedApplicantRecord)
146+
throw new Error(
147+
`No reviewed applicant record with ${applicantRecordId} and ${reviewerId} found.`,
148+
);
138149
reviewedApplicantRecord.reviewerHasConflict = true;
139150
await reviewedApplicantRecord.save();
140151
return toReviewedApplicantRecordDTO(reviewedApplicantRecord);
141-
}
142-
catch (error: unknown) {
143-
Logger.error(`Failed to report conflict. Reason = ${getErrorMessage(error)}`);
152+
} catch (error: unknown) {
153+
Logger.error(
154+
`Failed to report conflict. Reason = ${getErrorMessage(error)}`,
155+
);
144156
throw error;
145157
}
146158
}

backend/typescript/services/interfaces/IReviewPageService.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { ApplicationDTO, ReviewedApplicantRecordDTO, ReviewedApplicantsDTO } from "../../types";
1+
import {
2+
ApplicationDTO,
3+
ReviewedApplicantRecordDTO,
4+
ReviewedApplicantsDTO,
5+
} from "../../types";
26

37
interface IReviewPageService {
48
/**
@@ -20,7 +24,10 @@ interface IReviewPageService {
2024
* @param applicantRecordId the id of the applicant record that the reviewer is interested in
2125
* @param reviewerId the id of the reviewer that is reporting the conflict
2226
*/
23-
reportReviewConflict(applicantRecordId: string, reviewerId: number): Promise<ReviewedApplicantRecordDTO>;
27+
reportReviewConflict(
28+
applicantRecordId: string,
29+
reviewerId: number,
30+
): Promise<ReviewedApplicantRecordDTO>;
2431
}
2532

2633
export default IReviewPageService;

0 commit comments

Comments
 (0)