Files
myeasycms-v2/packages/features/admin/src/lib/server/loaders/admin-dashboard.loader.ts
Giancarlo Buomprisco ba6e649461 Refactored Supabase Clients using the new recommended approach by Supabase by centralizing all clients around one single implementation. (#51)
The previous clients have been marked as deprecated and will be removed at some point.
2024-08-14 17:13:59 +08:00

22 lines
548 B
TypeScript

import 'server-only';
import { cache } from 'react';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { createAdminDashboardService } from '../services/admin-dashboard.service';
/**
* @name loadAdminDashboard
* @description Load the admin dashboard data.
* @param params
*/
export const loadAdminDashboard = cache(adminDashboardLoader);
function adminDashboardLoader() {
const client = getSupabaseServerClient();
const service = createAdminDashboardService(client);
return service.getDashboardData();
}