updateCustomer method
Update an existing customer
Implementation
@override
Future<Map<String, dynamic>> updateCustomer(String customerId, Map<String, dynamic> customerData) async {
try {
final response = await http.put(
Uri.parse('$_sotaidApiUrl/customers/$customerId'),
headers: getHeaders(),
body: jsonEncode(customerData),
);
if (response.statusCode == 200) {
return jsonDecode(response.body);
} else {
throw Exception('Failed to update customer: ${response.statusCode}');
}
} catch (e) {
throw Exception('Error updating customer: $e');
}
}