import api, { unwrap } from './request';

export interface CommonCode {
  codeId: number;
  groupCode: string;
  code: string;
  codeName: string;
  sortOrder: number;
}

export const codeApi = {
  byGroup: (groupCode: string) =>
    unwrap<CommonCode[]>(api.get(`/api/common/codes/${groupCode}`)),
};
