getEmpresas method
Implementation
Future<List<Empresa>> getEmpresas(List<String> licencias) async {
var settings = SystemStorageManager().instance<ServerSettingsSorage>().getValue();
if (settings == null) throw Exception("invalid settings");
final uri = ApiService.parseUri(await settings.recoveryIndentityServiceAddress(), "/v1/get-licence-empresa");
var result = await ApiService.postWithUri(uri, payload: {
"licence": licencias,
});
if (result == null) return [];
final empresas = <Empresa>[];
for (var r in result) {
empresas.add(Empresa.fromMap(r));
}
return empresas;
}