Skip to content

Commit 0af8c92

Browse files
committed
Prettier fix
1 parent 70b4b58 commit 0af8c92

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

backend/controllers/committeeController.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { NextFunction, Request, Response } from 'express'
22
import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError'
33
import { CommitteeModel } from '../models/Committee'
4-
import { ELECTION_COMMITTEE_ID, MAIN_BOARD_ID, LAW_COMMITTEE_ID } from '../utils/constants'
4+
import {
5+
ELECTION_COMMITTEE_ID,
6+
MAIN_BOARD_ID,
7+
LAW_COMMITTEE_ID,
8+
} from '../utils/constants'
59
import { RequestWithNtnuiNo } from '../utils/request'
610
import { getUserRoleInCommitteeByUserId } from '../utils/userCommittee'
711

@@ -14,7 +18,7 @@ const getCommittees = (_req: Request, res: Response) => {
1418
async function acceptAdmissions(
1519
req: RequestWithNtnuiNo,
1620
res: Response,
17-
next: NextFunction
21+
next: NextFunction,
1822
) {
1923
try {
2024
const { ntnuiNo } = req
@@ -34,12 +38,12 @@ async function acceptAdmissions(
3438
committee._id !== MAIN_BOARD_ID) ||
3539
// If user part of election committee, allow toggle of own, main board and the law committee
3640
(userCommittee.committee === ELECTION_COMMITTEE_ID &&
37-
committee._id === userCommittee.committee ||
38-
committee._id === MAIN_BOARD_ID ||
39-
committee._id === LAW_COMMITTEE_ID) ||
41+
committee._id === userCommittee.committee) ||
42+
committee._id === MAIN_BOARD_ID ||
43+
committee._id === LAW_COMMITTEE_ID ||
4044
// If user is board member of the committee and is not in the main board
4145
(userCommittee.committee === committee._id &&
42-
committee._id !== MAIN_BOARD_ID)
46+
committee._id !== MAIN_BOARD_ID),
4347
)
4448
if (isAuthorized) {
4549
// Toggle accepts_admissions for a committee
@@ -50,13 +54,13 @@ async function acceptAdmissions(
5054
.then(() =>
5155
res.status(200).json({
5256
accepts_admissions: committee.accepts_admissions,
53-
})
57+
}),
5458
)
5559
.catch((err) => res.status(500).json({ message: err.message }))
5660
}
5761
throw new CustomError(
5862
'You are not authorized to change the admission status of this committee',
59-
403
63+
403,
6064
)
6165
} catch (error) {
6266
return next(error)

0 commit comments

Comments
 (0)