Skip to content

Commit eef0a31

Browse files
committed
fix lint
1 parent bec5e5c commit eef0a31

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

src/api/functions/entraId.ts

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { execCouncilGroupId, execCouncilTestingGroupId, genericConfig, officersGroupId, officersGroupTestingId } from "../../common/config.js";
1+
import {
2+
execCouncilGroupId,
3+
execCouncilTestingGroupId,
4+
genericConfig,
5+
officersGroupId,
6+
officersGroupTestingId,
7+
} from "../../common/config.js";
28
import {
39
BaseError,
410
EntraGroupError,
@@ -192,16 +198,29 @@ export async function modifyGroup(
192198
});
193199
}
194200
// if adding to exec group, check that all exec members we want to add are paid members
195-
const paidMemberRequiredGroups = [execCouncilGroupId, execCouncilTestingGroupId, officersGroupId, officersGroupTestingId]
196-
if (paidMemberRequiredGroups.includes(group) && action === EntraGroupActions.ADD) {
201+
const paidMemberRequiredGroups = [
202+
execCouncilGroupId,
203+
execCouncilTestingGroupId,
204+
officersGroupId,
205+
officersGroupTestingId,
206+
];
207+
if (
208+
paidMemberRequiredGroups.includes(group) &&
209+
action === EntraGroupActions.ADD
210+
) {
197211
const netId = email.split("@")[0];
198-
const response = await fetch(`https://membership.acm.illinois.edu/api/v1/checkMembership?netId=${netId}`);
199-
const membershipStatus = await response.json() as { netId: string, isPaidMember: boolean };
200-
if (!membershipStatus['isPaidMember']) {
212+
const response = await fetch(
213+
`https://membership.acm.illinois.edu/api/v1/checkMembership?netId=${netId}`,
214+
);
215+
const membershipStatus = (await response.json()) as {
216+
netId: string;
217+
isPaidMember: boolean;
218+
};
219+
if (!membershipStatus["isPaidMember"]) {
201220
throw new EntraGroupError({
202221
message: `${netId} is not a paid member. This group requires that all members are paid members.`,
203-
group
204-
})
222+
group,
223+
});
205224
}
206225
}
207226
try {
@@ -233,7 +252,10 @@ export async function modifyGroup(
233252
const errorData = (await response.json()) as {
234253
error?: { message?: string };
235254
};
236-
if (errorData?.error?.message === "One or more added object references already exist for the following modified properties: 'members'.") {
255+
if (
256+
errorData?.error?.message ===
257+
"One or more added object references already exist for the following modified properties: 'members'."
258+
) {
237259
return true;
238260
}
239261
throw new EntraGroupError({

src/api/routes/iam.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ import {
2222
GetItemCommand,
2323
PutItemCommand,
2424
} from "@aws-sdk/client-dynamodb";
25-
import { execCouncilGroupId, execCouncilTestingGroupId, genericConfig } from "../../common/config.js";
25+
import {
26+
execCouncilGroupId,
27+
execCouncilTestingGroupId,
28+
genericConfig,
29+
} from "../../common/config.js";
2630
import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
2731
import {
2832
InviteUserPostRequest,

0 commit comments

Comments
 (0)