Skip to content

Commit 18a5fa1

Browse files
committed
Fixed ministry memeber check
1 parent d775f6f commit 18a5fa1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/helpers/SecondaryMenuHelper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class SecondaryMenuHelper {
1010
static getSecondaryMenu = (path: string, data: any) => {
1111
let result: { menuItems: MenuItem[]; label: string } = { menuItems: [], label: "" };
1212

13-
if (path.startsWith("/people") || path.startsWith("/groups") || path.startsWith("/attendance")) result = this.getPeopleMenu(path, data.search);
13+
if (path.startsWith("/people") || path.startsWith("/groups") || path.startsWith("/attendance")) result = this.getPeopleMenu(path, data.search, data?.isMinistryMember);
1414
else if (path.startsWith("/mobile")) result = this.getMobileMenu(path);
1515
else if (path.startsWith("/settings") || path.startsWith("/admin") || path.startsWith("/forms")) result = this.getSettingsMenu(path, data);
1616
else if (path.startsWith("/serving")) result = this.getServingMenu(path, data);
@@ -22,11 +22,11 @@ export class SecondaryMenuHelper {
2222
return result;
2323
};
2424

25-
static getPeopleMenu = (path: string, search?: string) => {
25+
static getPeopleMenu = (path: string, search?: string, isMinistryMember?: boolean) => {
2626
const menuItems: MenuItem[] = [];
2727
let label: string = "";
2828
menuItems.push({ url: "/groups", label: Locale.label("components.wrapper.groups"), icon: "groups" });
29-
if (UserHelper.checkAccess(Permissions.membershipApi.plans.edit) || data?.isMinistryMember) menuItems.push({ url: "/serving", label: Locale.label("components.wrapper.teams"), icon: "people" });
29+
if (UserHelper.checkAccess(Permissions.membershipApi.plans.edit) || isMinistryMember) menuItems.push({ url: "/serving", label: Locale.label("components.wrapper.teams"), icon: "people" });
3030
menuItems.push({ url: "/people", label: Locale.label("components.wrapper.ppl"), icon: "person" });
3131
if (UserHelper.checkAccess(Permissions.attendanceApi.attendance.viewSummary)) menuItems.push({ url: "/attendance", label: Locale.label("components.wrapper.att"), icon: "calendar_month" });
3232

0 commit comments

Comments
 (0)