fix(frontend): Use correct admin endpoint for company pagination
This commit is contained in:
parent
7bb081f7c2
commit
398f1904dd
1 changed files with 14 additions and 4 deletions
|
|
@ -109,10 +109,20 @@ export const adminUsersApi = {
|
||||||
// Note: Backend endpoint is /api/v1/companies for listing (likely public or admin) and creation
|
// Note: Backend endpoint is /api/v1/companies for listing (likely public or admin) and creation
|
||||||
// Assuming specific admin endpoints might be added later, for now using existing
|
// Assuming specific admin endpoints might be added later, for now using existing
|
||||||
export const adminCompaniesApi = {
|
export const adminCompaniesApi = {
|
||||||
list: (page = 1, limit = 10) => {
|
list: (verified?: boolean, page = 1, limit = 10) => {
|
||||||
// Backend currently returns array, need to update backend to support pagination or wrap here
|
const query = new URLSearchParams({
|
||||||
// For now, assuming backend was updated or we simulate
|
page: page.toString(),
|
||||||
return apiRequest<any[]>(`/api/v1/companies?page=${page}&limit=${limit}`);
|
limit: limit.toString(),
|
||||||
|
...(verified !== undefined && { verified: verified.toString() })
|
||||||
|
});
|
||||||
|
return apiRequest<{
|
||||||
|
data: any[];
|
||||||
|
pagination: {
|
||||||
|
page: number;
|
||||||
|
limit: number;
|
||||||
|
total: number;
|
||||||
|
}
|
||||||
|
}>(`/api/v1/admin/companies?${query.toString()}`);
|
||||||
},
|
},
|
||||||
create: (data: any) => {
|
create: (data: any) => {
|
||||||
logCrudAction("create", "admin/companies", data);
|
logCrudAction("create", "admin/companies", data);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue