Skip to content

Commit de7cc90

Browse files
committed
fix: coderabbitai suggestion
1 parent 1cd07a3 commit de7cc90

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/graphql/types/Mutation/blockUser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ builder.mutationField("blockUser", (t) =>
8686
assertOrganizationAdmin(
8787
currentUser,
8888
currentUserOrganizationMembership,
89-
"You must be an admin of this organization to block users."
89+
"You must be an admin of this organization to block users.",
9090
);
9191

9292
const [targetUser, targetUserMembership, existingBlock] =

src/graphql/types/Mutation/unblockUser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ builder.mutationField("unblockUser", (t) =>
9595
assertOrganizationAdmin(
9696
currentUser,
9797
currentUserOrganizationMembership,
98-
"You must be an admin of this organization to unblock users."
98+
"You must be an admin of this organization to unblock users.",
9999
);
100100

101101
const [targetUser, existingBlock] = await Promise.all([

src/utilities/authorization.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import { TalawaGraphQLError } from "./TalawaGraphQLError";
22

33
interface HasRole {
4-
role?: string | null;
4+
role?: string | null;
55
}
66

77
export const assertOrganizationAdmin = (
8-
currentUser: HasRole | undefined,
9-
membership: HasRole | undefined,
10-
errorMessage: string,
8+
currentUser: HasRole | undefined,
9+
membership: HasRole | undefined,
10+
errorMessage: string,
1111
): void => {
12-
if (
13-
currentUser?.role !== "administrator" &&
14-
membership?.role !== "administrator"
15-
) {
16-
throw new TalawaGraphQLError({
17-
extensions: {
18-
code: "unauthorized_action",
19-
message: errorMessage,
20-
},
21-
});
22-
}
12+
if (
13+
currentUser?.role !== "administrator" &&
14+
membership?.role !== "administrator"
15+
) {
16+
throw new TalawaGraphQLError({
17+
extensions: {
18+
code: "unauthorized_action",
19+
message: errorMessage,
20+
},
21+
});
22+
}
2323
};

0 commit comments

Comments
 (0)