Manage Beneficiary delete Confirm
This commit is contained in:
@@ -105,17 +105,17 @@ class BeneficiaryService {
|
||||
}
|
||||
}
|
||||
|
||||
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()}');
|
||||
}
|
||||
}
|
||||
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()}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ void _showDeleteConfirmationDialog(BuildContext context) {
|
||||
TextButton(
|
||||
child: const Text('Delete'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
//Navigator.of(context).pop();
|
||||
_deleteBeneficiary(context);
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user