updated event controllers and service event mtach tested
This commit is contained in:
@@ -33,6 +33,6 @@ export default async function ProtectedLayout({
|
||||
const headersList = await headers();
|
||||
// const locale = getLocaleFromPath(removeSubStringFromPath(headersList));
|
||||
const removedLocaleRoute = removeSubStringFromPath(headersList);
|
||||
console.log('Removed locale route:', removedLocaleRoute);
|
||||
// console.log('Removed locale route:', removedLocaleRoute);
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
'use server';
|
||||
import React from 'react';
|
||||
import { dashboardPages } from '@/pages/office/dashboard/mapper';
|
||||
import { renderPage } from '@/lib/page';
|
||||
import { getSelectToken } from '@/fetchers/token/select';
|
||||
|
||||
|
||||
export default async function DashboardPage() {
|
||||
const pageUrl = "/office/dashboard";
|
||||
const selectToken = await getSelectToken();
|
||||
const RenderPage = renderPage(selectToken, pageUrl, dashboardPages);
|
||||
if (RenderPage) {
|
||||
|
||||
return <>
|
||||
<div>Dashboard Page</div>
|
||||
<div className='flex align-center justify-center h-screen w-screen mt-10 text-2xl'>
|
||||
<RenderPage />
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
return <>
|
||||
<div>Dashboard Page</div>
|
||||
<div>You are not allowed to reach any page under {pageUrl}. Please contact your administrator.</div>
|
||||
</>;
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
'use server';
|
||||
import React from 'react';
|
||||
import { dashboardPages } from '@/pages/venue/dashboard/mapper';
|
||||
import { renderPage } from '@/lib/page';
|
||||
import { getSelectTokenObject } from '@/fetchers/token/select';
|
||||
|
||||
export default async function DashboardPage() {
|
||||
const pageUrl = "/venue/dashboard";
|
||||
const selectToken = await getSelectTokenObject();
|
||||
if (!selectToken) {
|
||||
const RenderPage = renderPage(selectToken, pageUrl, dashboardPages);
|
||||
if (RenderPage) {
|
||||
return <>
|
||||
<div>Dashboard Page</div>
|
||||
<div className='flex align-center justify-center h-screen w-screen mt-10 text-2xl'>
|
||||
<RenderPage />
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
return <>
|
||||
<div>Dashboard Page</div>
|
||||
<div>You are not allowed to reach any page under {pageUrl}. Please contact your administrator.</div>
|
||||
</>;
|
||||
};
|
||||
Reference in New Issue
Block a user