@bit-ui-libs/common
Version:
This library was generated with [Nx](https://nx.dev).
22 lines (17 loc) • 776 B
text/typescript
import { BaseService, BaseServiceOptions } from '../../api/services/base-service';
import { PagedResponse } from '../../common';
import { ChainItDocumentType } from '../interfaces';
import { ListDocumentTypesRequest, SearchDocumentTypesRequest } from './document-types.service.interfaces';
export class DocumentTypesService extends BaseService {
protected dtApiUrl: string;
constructor(opts: BaseServiceOptions) {
super(opts);
this.dtApiUrl = `${this.apiUrl}/users/v1/document-types`;
}
searchDocumentTypes(req: SearchDocumentTypesRequest) {
return this.get<PagedResponse<ChainItDocumentType>>(this.dtApiUrl, req);
}
listDocumentTypes(req: ListDocumentTypesRequest) {
return this.get<ChainItDocumentType[]>(`${this.dtApiUrl}/list`, req);
}
}