chore: ticket section implement sse

This commit is contained in:
2026-06-19 18:06:11 +05:30
parent a567a52e26
commit fffd8e3e12
25 changed files with 711 additions and 307 deletions

View File

@@ -4,6 +4,7 @@ import { ROUTES } from '@/utils/routes';
export type AppRoute = {
path: string;
permission?: string;
match?: 'exact' | 'prefix';
};
export const appRoutes: AppRoute[] = [
@@ -23,8 +24,21 @@ export const appRoutes: AppRoute[] = [
path: ROUTES.PLANS,
permission: PERMISSIONS.PLAN.READ,
},
{
path: ROUTES.UPLOAD,
permission: PERMISSIONS.VIDEO.UPLOAD,
},
{
path: ROUTES.TICKET,
permission: PERMISSIONS.TICKET.READ,
match: 'prefix',
},
];
export function getRoutePermission(pathname: string) {
return appRoutes.find((route) => route.path === pathname)?.permission;
return appRoutes.find((route) =>
route.match === 'prefix'
? pathname === route.path || pathname.startsWith(`${route.path}/`)
: route.path === pathname,
)?.permission;
}