@bit-ui-libs/common
Version:
This library was generated with [Nx](https://nx.dev).
21 lines (15 loc) • 649 B
text/typescript
import { BaseService, BaseServiceOptions } from '../../api/services/base-service';
import { PagedResponse } from '../../common';
import { UserTypeEnum } from '../enums';
import { SearchRolesRequest, Role } from './role.service.interfaces';
type RoleServiceOptions = BaseServiceOptions & { userType: UserTypeEnum };
export class RoleService extends BaseService {
protected rolesApiUrl: string;
constructor(opts: RoleServiceOptions) {
super(opts);
this.rolesApiUrl = `${this.apiUrl}/users/v1/${opts.userType}/roles`;
}
searchRoles(req?: SearchRolesRequest) {
return this.get<PagedResponse<Role>>(this.rolesApiUrl, req);
}
}