- Upgrade Nx 22.1.1 → 22.6.3 and all patch/minor dependencies - Restructure shared libs: move business logic from utils to service - Consolidate shadcn-ui into ui lib with atomic design pattern - Fix container centering for landing app (Tailwind v4 compatibility) - Fix button styling by updating @source directive in globals.css - Fix SiCss3 → SiCss rename in react-icons 5.6 - Fix duplicate useSession export conflict - Remove dead code, comments, and unused files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.0 KiB
TypeScript
52 lines
1.0 KiB
TypeScript
import { api } from '../index';
|
|
import type {
|
|
TAdminUsersResponse,
|
|
TAdminTeamsResponse,
|
|
TAdminSubmissionsResponse,
|
|
} from '../../types/admin';
|
|
|
|
const ADMIN_BASE_URL = '/admin';
|
|
|
|
export const getAdminUsers = async (params?: {
|
|
page?: number;
|
|
per_page?: number;
|
|
search?: string;
|
|
is_admin?: boolean;
|
|
}) => {
|
|
const response = await api.get<TAdminUsersResponse>(
|
|
`${ADMIN_BASE_URL}/users`,
|
|
{
|
|
params: {
|
|
...params,
|
|
is_admin: params?.is_admin ?? false,
|
|
},
|
|
}
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const getAdminTeams = async (params?: {
|
|
page?: number;
|
|
per_page?: number;
|
|
search?: string;
|
|
}) => {
|
|
const response = await api.get<TAdminTeamsResponse>(
|
|
`${ADMIN_BASE_URL}/teams`,
|
|
{ params }
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const getAdminSubmissions = async (params?: {
|
|
page?: number;
|
|
per_page?: number;
|
|
search?: string;
|
|
status?: string;
|
|
}) => {
|
|
const response = await api.get<TAdminSubmissionsResponse>(
|
|
`${ADMIN_BASE_URL}/submissions`,
|
|
{ params }
|
|
);
|
|
return response.data;
|
|
};
|