updateProfile static method

Future updateProfile(
  1. dynamic data
)

Implementation

static Future updateProfile(data) async {
  try {

    final jsonData = await StoreBountyInit.readJsonFromRoot();


    final response = await HttpClientClass
        .putRequestAuthToken("${jsonData['BASE_URL']}/accounts/api/v1/users/update", data);

    // print(response.body);
    if (response.statusCode == 200) {

      return response;
    } else if (response.statusCode == 412) {
      var error = jsonDecode(response.body);
      throw StoreBountyException(error['message']);
    } else {
      var error = jsonDecode(response.body);
      throw StoreBountyException("${error['message']}");
    }
  } catch (e) {
    throw StoreBountyException("$e");
  }
}