deleteProfile static method
Deletes the profile for the current logged in user.
- Parameters:
manager
: An optionalMBManager
used to make calls instead ofMBManager.shared
.
- Returns a Future that completes when the profile is deleted correctly.
Implementation
static Future<void> deleteProfile({
MBManager? manager,
}) async {
MBManager mbManager = manager ?? MBManager.shared;
String apiName = 'api/profile/delete';
Map<String, String> apiParameters = await mbManager.defaultParameters();
var uri = Uri.https(mbManager.endpoint, apiName, apiParameters);
Map<String, String> headers = await mbManager.headers();
http.Response response = await http.delete(
uri,
headers: headers,
);
MBManager.checkResponse(response.body, checkBody: false);
await _setUserLoggedOut();
}