import { Injectable } from '@angular/core';
import { ConfigService } from '@shared/config/config.service';
import { FleioApiService } from '../../fleio-api.service';
import { HttpClient } from '@angular/common/http';
import { IRoleModel } from '@fleio-api/client-user/roles/model/role.model';
import { FleioObjectsList } from '@fleio-api/fleio-objects-list';
import { Observable } from 'rxjs/internal/Observable';

@Injectable({
  providedIn: 'root'
})
export class RolesApiService extends FleioApiService<IRoleModel> {
  // noinspection JSUnusedGlobalSymbols
  constructor(protected httpClient: HttpClient, protected config: ConfigService) {
    super();
    this.setEndpoint(config.getPanelApiUrl('roles'));
  }

  getPossibleParents(params): Observable<FleioObjectsList<IRoleModel>> {
    return this.getAction('get-possible-parents', params);
  }
}
