postIgnoreSharedDevice method

  1. @override
Future<bool> postIgnoreSharedDevice(
  1. String deviceId,
  2. String vcode
)
override

Implementation

@override
Future<bool> postIgnoreSharedDevice(String deviceId, String vcode) async {
  try {
    final String body = json.encode({'device_id': deviceId, 'vcode': vcode});
    return await dio
        .post('${ApiEndpoints.SHARE}/3', data: body)
        .then((value) => true);
  } on Exception catch (e) {
    throw HttpHelper.decodeErrorResponse(e,
        tag: TAG,
        logger: logger,
        defaultErrorMessage: 'Failed to discard this shared device',
        meta: {
          'device': deviceId,
          'vcode': vcode,
          'method': 'postIgnoreSharedDevice'
        });
  }
}