mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:56:28 +00:00
279b642a7a
Enforce page access and action-level permissions across admin and task views, including exports and record actions. Move user creation to a client component behind server-side permission checks, standardize data fetching, and remove the deprecated user-role route.
29 lines
895 B
TypeScript
29 lines
895 B
TypeScript
import { type Metadata } from 'next';
|
|
import { Suspense } from 'react';
|
|
import LazyLoading from '@/components/loader/LazyLoading';
|
|
import { getAccessPagePermission } from '@/lib/get-access-data';
|
|
import UserCreateClient from './UserCreateClient';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Admin | User Form",
|
|
description: "Create or update employee user information",
|
|
};
|
|
|
|
type Props = {
|
|
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
|
|
};
|
|
|
|
export default async function UserCreatePage({ searchParams }: Props) {
|
|
const params = await searchParams;
|
|
const isUpdate = params?.is_update === 'true';
|
|
await getAccessPagePermission('/administration/user', isUpdate ? 'UPDATE' : 'CREATE');
|
|
|
|
return (
|
|
<Suspense fallback={<LazyLoading />}>
|
|
<UserCreateClient />
|
|
</Suspense>
|
|
);
|
|
}
|