forked from cardosofelipe/fast-next-template
Refactor and centralize user and pagination interfaces in useAdmin hook
- Unified `User` and `PaginationMeta` type definitions into `useAdmin` to improve maintainability and consistency. - Updated affected components (`UserManagementContent`, `UserListTable`, `UserFormDialog`, `UserActionMenu`) to reference the centralized types. - Enhanced test coverage for user-related hooks to include create, update, delete, activate, deactivate, and bulk actions.
This commit is contained in:
@@ -29,25 +29,7 @@ import {
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import { UserActionMenu } from './UserActionMenu';
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
first_name: string;
|
||||
last_name: string | null;
|
||||
is_active: boolean;
|
||||
is_superuser: boolean;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
interface PaginationMeta {
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
total_pages: number;
|
||||
has_next: boolean;
|
||||
has_prev: boolean;
|
||||
}
|
||||
import type { User, PaginationMeta } from '@/lib/api/hooks/useAdmin';
|
||||
|
||||
interface UserListTableProps {
|
||||
users: User[];
|
||||
|
||||
Reference in New Issue
Block a user