From 70767a1b2407382bf87248d41d3a5c8eb0feed18 Mon Sep 17 00:00:00 2001 From: sianida26 Date: Wed, 15 May 2024 20:08:45 +0700 Subject: [PATCH] lint --- apps/backend/src/routes/dashboard/routes.ts | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/apps/backend/src/routes/dashboard/routes.ts b/apps/backend/src/routes/dashboard/routes.ts index 9c3871f..a06c669 100644 --- a/apps/backend/src/routes/dashboard/routes.ts +++ b/apps/backend/src/routes/dashboard/routes.ts @@ -76,19 +76,14 @@ const dashboardRoutes = router.get("/getSidebarItems", async (c) => { } //if menu has no children, check if permission match - else { - if ( - menu.allowedPermissions?.some((perm) => - permissions.includes(perm) - ) || - menu.allowedPermissions?.includes("*") - ) { - //add menu and hide the allowed permissions field - return [ - ...prev, - { ...menu, allowedPermissions: undefined }, - ]; - } + else if ( + menu.allowedPermissions?.some((perm) => + permissions.includes(perm) + ) || + menu.allowedPermissions?.includes("*") + ) { + //add menu and hide the allowed permissions field + return [...prev, { ...menu, allowedPermissions: undefined }]; } //dont add permission to menu if it doesnt match