/**
 * 药品计量单位字典 API（yii_west_unit）
 */
import { requestClient } from '#/api/request';

const prefix = 'west-unit-dict/';

export async function getWestUnitDictList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

export async function getWestUnitDictOption() {
  return requestClient.get<{ value: number; label: string }[]>(
    `${prefix}option`,
  );
}

export async function createWestUnitDict(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

export async function updateWestUnitDict(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

export async function deleteWestUnitDict(data: { ids: number[] }) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
