feat: Implement a structured API service layer for authentication and user management, replacing the old API utility.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { api, type User } from '@/lib/api';
|
||||
import { usersService, User } from '@/services';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function DashboardPage() {
|
||||
@@ -21,7 +21,7 @@ export default function DashboardPage() {
|
||||
const fetchDashboardData = async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await api.getUsers(1, 100);
|
||||
const response = await usersService.getUsers({ page: 1, limit: 100 });
|
||||
const users = response.users || [];
|
||||
setStats({
|
||||
totalUsers: response.total || 0,
|
||||
|
||||
Reference in New Issue
Block a user