Skip to content

Commit 5e3f2a5

Browse files
committed
ran linter
1 parent 56ce6b2 commit 5e3f2a5

File tree

5 files changed

+28
-41
lines changed

5 files changed

+28
-41
lines changed

backend/typescript/graphql/resolvers/dashboardResolvers.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ const dashboardResolvers = {
3939
_parent: undefined,
4040
{ secondChoice }: { secondChoice: ApplicantRole },
4141
): Promise<Array<ApplicationDTO>> => {
42-
const applications = await dashboardService.getApplicationsBySecondChoiceRole(
43-
secondChoice,
44-
);
42+
const applications =
43+
await dashboardService.getApplicationsBySecondChoiceRole(secondChoice);
4544
return applications;
4645
},
4746
dashboardsByApplicationId: async (

backend/typescript/services/implementations/appDashboardService.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ class AppDashboardService implements IAppDashboardService {
166166
);
167167
},
168168
);
169-
applicationsBySecondChoiceRoleDTO = await applicationsBySecondChoiceRole.map(
170-
(application) => {
169+
applicationsBySecondChoiceRoleDTO =
170+
await applicationsBySecondChoiceRole.map((application) => {
171171
return {
172172
id: application.id,
173173
academicOrCoop: application.academicOrCoop,
@@ -191,8 +191,7 @@ class AppDashboardService implements IAppDashboardService {
191191
timesApplied: application.timesApplied,
192192
timestamp: application.timestamp,
193193
};
194-
},
195-
);
194+
});
196195
} catch (error: unknown) {
197196
Logger.error(
198197
`Failed to get applications by this second choice role = ${role}. Reason = ${getErrorMessage(
@@ -243,15 +242,13 @@ class AppDashboardService implements IAppDashboardService {
243242
role: ApplicantRole,
244243
): Promise<ApplicationDashboardRowDTO[]> {
245244
// get all the applications for the role
246-
const applications: Array<ApplicationDTO> = await this.getApplicationsByRole(
247-
role,
248-
);
245+
const applications: Array<ApplicationDTO> =
246+
await this.getApplicationsByRole(role);
249247
// get the dashboards associated with the applications
250248
const appDashRows: Array<ApplicationDashboardRowDTO> = await Promise.all(
251249
applications.map(async (application) => {
252-
const reviewDashboards: Array<ApplicationDashboardDTO> = await this.getDashboardsByApplicationId(
253-
application.id,
254-
);
250+
const reviewDashboards: Array<ApplicationDashboardDTO> =
251+
await this.getDashboardsByApplicationId(application.id);
255252
const reviewers: Array<UserDTO> = await Promise.all(
256253
reviewDashboards.map(async (dash) => {
257254
return userService.getUserByEmail(dash.reviewerEmail);
@@ -271,15 +268,13 @@ class AppDashboardService implements IAppDashboardService {
271268
role: ApplicantRole,
272269
): Promise<ApplicationDashboardRowDTO[]> {
273270
// get all the applications for the role
274-
const applications: Array<ApplicationDTO> = await this.getApplicationsBySecondChoiceRole(
275-
role,
276-
);
271+
const applications: Array<ApplicationDTO> =
272+
await this.getApplicationsBySecondChoiceRole(role);
277273
// get the dashboards associated with the applications
278274
const appDashRows: Array<ApplicationDashboardRowDTO> = await Promise.all(
279275
applications.map(async (application) => {
280-
const reviewDashboards: Array<ApplicationDashboardDTO> = await this.getDashboardsByApplicationId(
281-
application.id,
282-
);
276+
const reviewDashboards: Array<ApplicationDashboardDTO> =
277+
await this.getDashboardsByApplicationId(application.id);
283278
const reviewers: Array<UserDTO> = await Promise.all(
284279
reviewDashboards.map(async (dash) => {
285280
return userService.getUserByEmail(dash.reviewerEmail);

backend/typescript/services/implementations/authService.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ class AuthService implements IAuthService {
165165
roles: Set<Role>,
166166
): Promise<boolean> {
167167
try {
168-
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken = await firebaseAdmin
169-
.auth()
170-
.verifyIdToken(accessToken, true);
168+
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken =
169+
await firebaseAdmin.auth().verifyIdToken(accessToken, true);
171170
const userRole = await this.userService.getUserRoleByAuthId(
172171
decodedIdToken.uid,
173172
);
@@ -187,9 +186,8 @@ class AuthService implements IAuthService {
187186
requestedUserId: string,
188187
): Promise<boolean> {
189188
try {
190-
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken = await firebaseAdmin
191-
.auth()
192-
.verifyIdToken(accessToken, true);
189+
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken =
190+
await firebaseAdmin.auth().verifyIdToken(accessToken, true);
193191
const tokenUserId = await this.userService.getUserIdByAuthId(
194192
decodedIdToken.uid,
195193
);
@@ -211,9 +209,8 @@ class AuthService implements IAuthService {
211209
requestedEmail: string,
212210
): Promise<boolean> {
213211
try {
214-
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken = await firebaseAdmin
215-
.auth()
216-
.verifyIdToken(accessToken, true);
212+
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken =
213+
await firebaseAdmin.auth().verifyIdToken(accessToken, true);
217214

218215
const firebaseUser = await firebaseAdmin
219216
.auth()

backend/typescript/services/implementations/reviewService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ class ReviewService implements IReviewService {
1515
});
1616
if (users && users.length === 1) {
1717
const user = users[0];
18-
const application: ApplicationDashboardTable | null = await ApplicationDashboardTable.findOne(
19-
{
18+
const application: ApplicationDashboardTable | null =
19+
await ApplicationDashboardTable.findOne({
2020
where: {
2121
reviewerId: user.id,
2222
applicationId,
2323
},
24-
},
25-
);
24+
});
2625
if (application) return true;
2726
return false;
2827
}

backend/typescript/utilities/firebaseRestClient.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ const FirebaseRestClient = {
8181
},
8282
);
8383

84-
const responseJson:
85-
| PasswordSignInResponse
86-
| RequestError = await response.json();
84+
const responseJson: PasswordSignInResponse | RequestError =
85+
await response.json();
8786

8887
if (!response.ok) {
8988
const errorMessage = [
@@ -123,9 +122,8 @@ const FirebaseRestClient = {
123122
},
124123
);
125124

126-
const responseJson:
127-
| OAuthSignInResponse
128-
| RequestError = await response.json();
125+
const responseJson: OAuthSignInResponse | RequestError =
126+
await response.json();
129127

130128
if (!response.ok) {
131129
const errorMessage = [
@@ -155,9 +153,8 @@ const FirebaseRestClient = {
155153
},
156154
);
157155

158-
const responseJson:
159-
| RefreshTokenResponse
160-
| RequestError = await response.json();
156+
const responseJson: RefreshTokenResponse | RequestError =
157+
await response.json();
161158

162159
if (!response.ok) {
163160
const errorMessage = [

0 commit comments

Comments
 (0)