import httpClient from '@/api/httpClient';
import { API_URLS } from '@/api/URLs';
import { AxiosResponse } from 'axios';
import { AnnouncementDetailBody, AnnouncementListBody } from './type';

export const announcement_api = {
  async list(params: {
    page: number;
    page_size: number;
  }): Promise<AxiosResponse<AnnouncementListBody>> {
    const res = await httpClient.get(API_URLS.DASHBOARD_ADS, { params });
    return res;
  },

  async detail(id: number): Promise<AxiosResponse<AnnouncementDetailBody>> {
    const res = await httpClient.get(API_URLS.DASHBOARD_ADS_DETAIL(id));
    return res;
  },
};
