Skip to main content

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/companies page. Powers real-time search by company name or GSTIN, filtering by active status, and table pagination.

Where It Appears in the UI

  1. User visits /admin/companies.
  2. The table loads registered companies with user count, booking count, and credit terms.
  3. 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;
},
});
}