thingsboard / dart_thingsboard_client

ThingsBoard API client library for Dart developers.
BSD 3-Clause "New" or "Revised" License
60 stars 32 forks source link

Fix API to save new relation. #5

Closed devaskim closed 2 years ago

devaskim commented 2 years ago

Without this PR calling of saveRelation throws the error:

Error: ThingsboardError: message: [type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast], errorCode: 2, status: null
#0      toThingsboardError (package:thingsboard_client/src/error/_thingsboard_error_handler_io.dart:86:18)
#1      ThingsboardClient.post (package:thingsboard_client/src/thingsboard_client_base.dart:211:13)
<asynchronous suspension>
#2      EntityRelationService.saveRelation (package:thingsboard_client/src/service/entity_relation_service.dart:18:20)
<asynchronous suspension>