29 lines
817 B
TypeScript
29 lines
817 B
TypeScript
import { client } from "@/shared/api";
|
|
import type {
|
|
SiteAuthorityCreatePayload,
|
|
SiteAuthorityList,
|
|
SiteAuthoritySearchParams,
|
|
SiteAuthorityService,
|
|
} from "../model/site-authority-interface";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
|
|
export class SiteAuthorityApiService implements SiteAuthorityService {
|
|
public async getSiteAuthorityList(
|
|
params: SiteAuthoritySearchParams,
|
|
): Promise<SiteAuthorityList> {
|
|
const response = await client.get<SiteAuthorityList>(
|
|
ENDPOINT.CMS_SERVICE.SITE_AUTHORITY,
|
|
{ params },
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
public async createSiteAuthority(
|
|
data: SiteAuthorityCreatePayload[],
|
|
): Promise<void> {
|
|
await client.post(ENDPOINT.CMS_SERVICE.SITE_AUTHORITY, data);
|
|
}
|
|
}
|
|
|
|
export const SiteAuthorityApi = new SiteAuthorityApiService();
|