refactor: revew all design of services, clients, deadcode, ...
This commit is contained in:
@@ -1,26 +1,12 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { isUserAuthenticated } from "@/lib/server-auth";
|
||||
import { AdminService } from "@/services/admin-service";
|
||||
import { UsersManagementPage } from "@/components/admin/users";
|
||||
|
||||
export default async function UsersPage() {
|
||||
// Vérifier l'authentification
|
||||
const isAuthenticated = await isUserAuthenticated();
|
||||
|
||||
// Si pas de cookie d'authentification, rediriger vers login
|
||||
if (!isAuthenticated) {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
// Charger les données côté serveur
|
||||
try {
|
||||
const adminData = await AdminService.getAdminData();
|
||||
|
||||
return (
|
||||
<UsersManagementPage
|
||||
teams={adminData.teams}
|
||||
/>
|
||||
);
|
||||
return <UsersManagementPage teams={adminData.teams} />;
|
||||
} catch (error) {
|
||||
console.error("Failed to load admin data:", error);
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user