updateAccountStatus method
Implementation
@override
Future<Map> updateAccountStatus(
String token, String accountId, String nextStatus, String? force) async {
final String baseUrl = await getBaseUrl;
var url = Uri.parse(
"$baseUrl/api/v1/simulation/accounts/$accountId/update_status");
var bodyData = {"next_status": nextStatus};
if (force != null) {
bodyData.addAll({"force": force});
}
var jsonBody = jsonEncode(bodyData);
var response = await http.post(
url,
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer $token"
},
body: jsonBody,
);
var data = jsonDecode(response.body);
return data;
}