Skip to content

Commit 1cd07a3

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

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/utilities/authorization.ts

Lines changed: 15 additions & 15 deletions
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)