feat: Implement a structured API service layer for authentication and user management, replacing the old API utility.

This commit is contained in:
pradeepkumar
2025-12-22 11:53:38 +05:30
parent aa97e36cfd
commit c4ccb2bd6c
10 changed files with 469 additions and 198 deletions

View File

@@ -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,