import { API_ALARMS, API_ALARMS_CONFIRM } from '@/constants/api';
import { request } from '@umijs/max';

export async function apiGetAlarms(params?: MasterModel.SearchPaginationBody) {
  return request<MasterModel.AlarmsResponse>(API_ALARMS, {
    params: params,
  });
}

export async function apiConfirmAlarm(body: MasterModel.ConfirmAlarmRequest) {
  return request(API_ALARMS_CONFIRM, {
    method: 'POST',
    data: body,
    getResponse: true,
  });
}

export async function apiUnconfirmAlarm(body: MasterModel.ConfirmAlarmRequest) {
  return request(API_ALARMS_CONFIRM, {
    method: 'DELETE',
    data: body,
    getResponse: true,
  });
}
