findPefiles method

Future<List<EmpresaAppPerfil>> findPefiles(
  1. List<String> empresas
)

Implementation

Future<List<EmpresaAppPerfil>> findPefiles(List<String> empresas) async {
  var settings = SystemStorageManager().instance<ServerSettingsSorage>().getValue();
  if (settings == null) throw Exception("invalid settings");
  final uri = ApiService.parseUri(
    await settings.recoveryPreferenciaServiceAddress(),
    "/v1/api/perfiles",
  );
  var result = await ApiService.postWithUri(
    uri,
    payload: {"empresa": empresas, "servicio": settings.appID},
  );
  var perfiles = <EmpresaAppPerfil>[];
  for (var r in result) {
    perfiles.add(EmpresaAppPerfil.fromMap(r));
  }
  return perfiles;
}