add stuff table, add stuff remove and add interfaces

This commit is contained in:
smanylov
2026-05-18 16:25:22 +07:00
parent d9720843e7
commit 748c6cb38a
12 changed files with 1193 additions and 19 deletions
@@ -0,0 +1,43 @@
import { useQuery } from '@tanstack/react-query';
import { fetchStuffList } from '@/app/actions/stuffActions';
interface StaffMember {
id: number;
full_name: string;
email: string;
is_active: boolean;
is_super_admin: boolean;
created_at: string;
active_password: boolean;
permissions: {
subscriptions: number;
mailings: number;
complaints: number;
agreements: number;
staff: number;
content_moderation: number;
users: number;
kyc: number;
money: number;
claims: number;
api: number;
dash: number;
tariffs: number;
};
}
export const useStuffList = (page?: number, size?: number, sortBy?: string, sortDirection?: 'asc' | 'desc' | string, nameQuery?: string) => {
return useQuery({
queryKey: ['stuffList'],
queryFn: () => {
return fetchStuffList(page, size, sortBy, sortDirection, nameQuery)
},
select: (data: StaffMember[] | null) => {
if (!data) {
return null
}
return data;
},
retry: false
});
};