Fund Transfer page with Own Bank and Outside Bank modified
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:kmobile/data/models/ifsc.dart';
|
||||
import 'package:kmobile/data/models/beneficiary.dart';
|
||||
@@ -105,4 +104,18 @@ class BeneficiaryService {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> deleteBeneficiary(String accountNo) async {
|
||||
try {
|
||||
final response = await _dio.delete('/api/beneficiary/$accountNo');
|
||||
|
||||
if (response.statusCode != 204) {
|
||||
throw Exception('Failed to delete beneficiary');
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
throw Exception('Network error: ${e.message}');
|
||||
} catch (e) {
|
||||
throw Exception('Unexpected error: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user