29 lines
776 B
TypeScript
29 lines
776 B
TypeScript
import { apiClient } from "@/lib/api-client";
|
|
import { env } from "@/config/env";
|
|
import type { LoginInput, RegisterInput } from "./schemas";
|
|
|
|
export const adminService = {
|
|
login: async (data: LoginInput) => {
|
|
const response = await apiClient.post(
|
|
`/${env.endpoints.adminManagement}/auth`,
|
|
data
|
|
);
|
|
return response.data;
|
|
},
|
|
|
|
register: async (data: RegisterInput) => {
|
|
const response = await apiClient.post(
|
|
`/${env.endpoints.adminManagement}/register`,
|
|
data
|
|
);
|
|
return response.data;
|
|
},
|
|
|
|
getStats: async () => {
|
|
const response = await apiClient.get(
|
|
`/${env.endpoints.cmsManagement}/stats`
|
|
);
|
|
return response.data;
|
|
},
|
|
};
|