Company Directory & Listing
- API Endpoint:
GET /api/companies/list - Page Route:
/admin/companies - Component File:
src/features/companies/components/CompanyTable.tsx - Used For: Renders the main corporate clients table on the
/admin/companiespage. Powers real-time search by company name or GSTIN, filtering by active status, and table pagination.
Where It Appears in the UI
- User visits
/admin/companies. - The table loads registered companies with user count, booking count, and credit terms.
- Typing in the search bar sends a filtered request with
?search=<query>&page=1.
React Usage Example
import { useQuery } from '@tanstack/react-query';
import { apiClient } from '@/lib/apiClient';
export function useCompanyList(params: { search?: string; page: number; limit?: number }) {
return useQuery({
queryKey: ['companies', 'list', params],
queryFn: async () => {
const { data } = await apiClient.get('/api/companies/list', { params });
return data;
},
});
}