generateDileveryCode method

  1. @override
Future<Either<AppException, Response>> generateDileveryCode(
  1. String referenceNo
)
override

Implementation

@override
Future<Either<AppException, response.Response>> generateDileveryCode(
    String referenceNo) async {
  try {
    final eitherType =
        await networkService.post('generate-delivery-code', data: {
      'sale_reference_no': referenceNo,
    });
    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',
      ),
    );
  }
}