diff --git a/src/routes/admin/coupon.tsx b/src/routes/admin/coupon.tsx index a25df23..dcafafd 100644 --- a/src/routes/admin/coupon.tsx +++ b/src/routes/admin/coupon.tsx @@ -101,9 +101,9 @@ export default function CouponPage() { let r = coupons(); const q = search().toLowerCase(); if (q) - r = r.filter( + {r = r.filter( (c) => c.code.toLowerCase().includes(q) || (c.title || "").toLowerCase().includes(q) - ); + );} if (statusFilter() === "active") r = r.filter((c) => c.is_active); if (statusFilter() === "inactive") r = r.filter((c) => !c.is_active); const sorted = [...r]; diff --git a/src/routes/admin/department.tsx b/src/routes/admin/department.tsx index c8d093a..931a211 100644 --- a/src/routes/admin/department.tsx +++ b/src/routes/admin/department.tsx @@ -164,9 +164,9 @@ export default function DepartmentManagementPage() { sorted.sort((a, b) => { if (mode === "name_desc") return b.name.localeCompare(a.name); if (mode === "employees_desc") - return Number(b.totalEmployees || 0) - Number(a.totalEmployees || 0); + {return Number(b.totalEmployees || 0) - Number(a.totalEmployees || 0);} if (mode === "employees_asc") - return Number(a.totalEmployees || 0) - Number(b.totalEmployees || 0); + {return Number(a.totalEmployees || 0) - Number(b.totalEmployees || 0);} return a.name.localeCompare(b.name); }); r = sorted; @@ -646,7 +646,7 @@ export default function DepartmentManagementPage() { } ); if (!res.ok) - throw new Error(`Request failed (${res.status})`); + {throw new Error(`Request failed (${res.status})`);} } catch (err: any) { setError(err?.message || "Failed to update status."); } finally { diff --git a/src/routes/admin/designation.tsx b/src/routes/admin/designation.tsx index 7d97375..0c79eec 100644 --- a/src/routes/admin/designation.tsx +++ b/src/routes/admin/designation.tsx @@ -247,9 +247,9 @@ export default function DesignationManagementPage() { sorted.sort((a, b) => { if (mode === "name_desc") return b.name.localeCompare(a.name); if (mode === "employees_desc") - return Number(b.totalEmployees || 0) - Number(a.totalEmployees || 0); + {return Number(b.totalEmployees || 0) - Number(a.totalEmployees || 0);} if (mode === "employees_asc") - return Number(a.totalEmployees || 0) - Number(b.totalEmployees || 0); + {return Number(a.totalEmployees || 0) - Number(b.totalEmployees || 0);} return a.name.localeCompare(b.name); }); r = sorted; @@ -801,7 +801,7 @@ export default function DesignationManagementPage() { } ); if (!res.ok) - throw new Error(`Request failed (${res.status})`); + {throw new Error(`Request failed (${res.status})`);} } catch (err: any) { setError(err?.message || "Failed to update status."); } finally { diff --git a/src/routes/admin/employees/index.tsx b/src/routes/admin/employees/index.tsx index ffb4ff9..923df20 100644 --- a/src/routes/admin/employees/index.tsx +++ b/src/routes/admin/employees/index.tsx @@ -843,7 +843,7 @@ export default function EmployeeManagementPage() { type="button" onClick={async () => { if (!confirm(`Are you sure you want to delete ${row.name}?`)) - return; + {return;} setOpenMenuId(null); try { const accessToken = diff --git a/src/routes/admin/external-dashboard-management/index.tsx b/src/routes/admin/external-dashboard-management/index.tsx index 1a2775b..d54c019 100644 --- a/src/routes/admin/external-dashboard-management/index.tsx +++ b/src/routes/admin/external-dashboard-management/index.tsx @@ -278,7 +278,7 @@ function rolePreviewPath(roleKey: string): string { const key = String(roleKey || "").toUpperCase(); if (key.includes("COMPANY")) return "/employers/dashboard"; if (key.includes("CUSTOMER") || key.includes("SERVICE_SEEKER")) - return "/users/customer/dashboard"; + {return "/users/customer/dashboard";} if (key.includes("JOB_SEEKER") || key.includes("JOBSEEKER")) return "/users/candidate/dashboard"; if (key.includes("PHOTOGRAPHER")) return "/users/photographer/dashboard"; if (key.includes("MAKEUP")) return "/users/makeup/dashboard"; @@ -286,7 +286,7 @@ function rolePreviewPath(roleKey: string): string { if (key.includes("DEVELOPER")) return "/users/developers/dashboard"; if (key.includes("VIDEO")) return "/users/video-editors/dashboard"; if (key.includes("UGC") || (key.includes("CONTENT") && key.includes("CREATOR"))) - return "/users/ugc-content-creators/dashboard"; + {return "/users/ugc-content-creators/dashboard";} if (key.includes("FITNESS")) return "/users/fitness-trainers/dashboard"; if (key.includes("GRAPHIC")) return "/users/graphic-designers/dashboard"; if (key.includes("SOCIAL")) return "/users/social-media-managers/dashboard"; @@ -432,7 +432,7 @@ export default function ExternalDashboardManagementPage() { const key = role.key.toUpperCase(); if (key.includes("COMPANY")) map[role.id] = "COMPANY"; else if (key.includes("CUSTOMER") || key.includes("SERVICE_SEEKER")) - map[role.id] = "CUSTOMER"; + {map[role.id] = "CUSTOMER";} else if (key.includes("JOB_SEEKER") || key.includes("JOBSEEKER")) map[role.id] = "JOB_SEEKER"; else map[role.id] = "PROFESSIONAL"; } @@ -590,9 +590,7 @@ export default function ExternalDashboardManagementPage() { setRoles( roleRows - .filter((r: any) => { - return r?.status === "ACTIVE" || r?.status === "INACTIVE"; - }) + .filter((r: any) => r?.status === "ACTIVE" || r?.status === "INACTIVE") .map((r: any) => ({ id: String(r?.id || ""), key: String(r?.code || r?.key || "").toUpperCase(), diff --git a/src/routes/admin/external-roles.tsx b/src/routes/admin/external-roles.tsx index 6a67102..ed5e25f 100644 --- a/src/routes/admin/external-roles.tsx +++ b/src/routes/admin/external-roles.tsx @@ -220,18 +220,14 @@ export default function ExternalRoleManagementPage() { } }; - const getPermission = (moduleKey: string): RolePermission | undefined => { - return rolePermissions().find((p) => p.module_key === moduleKey); - }; + const getPermission = (moduleKey: string): RolePermission | undefined => rolePermissions().find((p) => p.module_key === moduleKey); const hasAnyPermission = (moduleKey: string) => { const p = getPermission(moduleKey); return p && (p.can_view || p.can_list || p.can_create || p.can_update || p.can_delete); }; - const permissionKeyFor = (moduleKey: string, action: string) => { - return `${moduleKey}_${action.toLowerCase()}`; - }; + const permissionKeyFor = (moduleKey: string, action: string) => `${moduleKey}_${action.toLowerCase()}`; const isAllSelectedForAction = (action: PermissionAction) => { const actionKey = action.toLowerCase(); diff --git a/src/routes/admin/index.tsx b/src/routes/admin/index.tsx index 5e2b6e9..47dc51a 100644 --- a/src/routes/admin/index.tsx +++ b/src/routes/admin/index.tsx @@ -283,13 +283,13 @@ export default function AdminHomePage() { if (key === "chart_leads_trend") { const data = m?.trend_series; if (data && data.length > 0) - return { state: "live", statusLabel: "Live Data", data: { trend_series: data } }; + {return { state: "live", statusLabel: "Live Data", data: { trend_series: data } };} return { state: "empty", statusLabel: "No Data" }; } if (key === "chart_revenue_overview") { const data = m?.rev_series; if (data && data.length > 0) - return { state: "live", statusLabel: "Live Data", data: { rev_series: data } }; + {return { state: "live", statusLabel: "Live Data", data: { rev_series: data } };} return { state: "empty", statusLabel: "No Data" }; } const meta = WIDGET_META[key]; diff --git a/src/routes/admin/pricing.tsx b/src/routes/admin/pricing.tsx index 5636777..e3dd663 100644 --- a/src/routes/admin/pricing.tsx +++ b/src/routes/admin/pricing.tsx @@ -272,12 +272,12 @@ export default function PricingPage() { let r = packages() ?? []; const q = search().toLowerCase(); if (q) - r = r.filter( + {r = r.filter( (p) => p.name.toLowerCase().includes(q) || p.package_type.toLowerCase().includes(q) || (p.applicable_roles ?? []).some((rl) => rl.toLowerCase().includes(q)), - ); + );} if (typeFilter() !== 'all') r = r.filter((p) => p.package_type === typeFilter()); if (statusFilter() === 'active') r = r.filter((p) => p.is_active); if (statusFilter() === 'inactive') r = r.filter((p) => !p.is_active); @@ -411,9 +411,7 @@ export default function PricingPage() { }); }; - const getTypeLabel = (type: string) => { - return PACKAGE_TYPES.find((t) => t.value === type)?.label || type; - }; + const getTypeLabel = (type: string) => PACKAGE_TYPES.find((t) => t.value === type)?.label || type; return (