added wallet functionality
This commit is contained in:
@@ -403,7 +403,7 @@ class BatchController extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<ApiResponse<GroupBatch>> pollBatch(
|
||||
Future<ApiResponse<TransactionModel>> pollBatch(
|
||||
String batchId,
|
||||
String userId,
|
||||
) async {
|
||||
@@ -418,11 +418,18 @@ class BatchController extends ChangeNotifier {
|
||||
body.toJson(),
|
||||
);
|
||||
final response = _unwrap(raw);
|
||||
final batch = GroupBatch.fromJson(response as Map<String, dynamic>);
|
||||
model.currentBatch = batch;
|
||||
final batchTransaction = TransactionModel.fromJson(
|
||||
response as Map<String, dynamic>,
|
||||
);
|
||||
model.isActing = false;
|
||||
if (!_disposed) notifyListeners();
|
||||
return ApiResponse.success(batch);
|
||||
if (response['status'] != 'FAILED') {
|
||||
return ApiResponse.success(batchTransaction);
|
||||
} else {
|
||||
return ApiResponse.failure(
|
||||
response['errorMessage'] ?? "Transaction failed",
|
||||
);
|
||||
}
|
||||
} catch (e, s) {
|
||||
logger.e(e);
|
||||
logger.e(s);
|
||||
|
||||
Reference in New Issue
Block a user