getReasonList method

  1. @override
Future<Either<AppException, Response>> getReasonList(
  1. String? allowedType,
  2. int statusId
)
override

Implementation

@override
Future<Either<AppException, response.Response>> getReasonList(
    String? allowedType, int statusId) async {
  try {
    final eitherType = await networkService.post('get-reasons', data: {
      'allowed_type': allowedType,
      'status_id': statusId,
    });
    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',
      ),
    );
  }
}