updateBeneficiary method
Implementation
@override
Future<Map> updateBeneficiary(String token, String beneficiaryId,
Map<String, dynamic> newBeneficiaryInfo) async {
final baseUrl = await getBaseUrl;
var url = Uri.parse("$baseUrl/api/v1/beneficiaries/update/$beneficiaryId");
var jsonBody = jsonEncode(newBeneficiaryInfo);
var response = await http.post(
url,
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer $token",
"headers": "[object Object]"
},
body: jsonBody,
);
var data = jsonDecode(response.body);
return data;
}