markAsReceived method

  1. @override
Future<Either<AppException, Response>> markAsReceived({
  1. required String jsonString,
  2. required int orderId,
})
override

Implementation

@override
Future<Either<AppException, response.Response>> markAsReceived(
    {required String jsonString, required int orderId}) async {
  try {
    final eitherType =
        await networkService.post('return-sale/mark_as_received', data: {
      'serialno': jsonString,
      'return_id': orderId,
    });
    return eitherType.fold(
      (exception) {
        return Left(exception);
      },
      (response) {
        return Right(response);
      },
    );
  } catch (e) {
    return Left(
      AppException(
        message: 'Unknown error occured',
        statusCode: 1,
        identifier: '${e.toString()}\nLoginUserRemoteDataSource.loginUser',
      ),
    );
  }
}