added user delete feture

This commit is contained in:
Mohamed Nouffer
2023-01-06 16:48:47 +05:30
parent d56ed36be5
commit 615c086c24
3 changed files with 44 additions and 3 deletions

View File

@ -77,6 +77,25 @@ class AuthService{
return cats;
}
static Future<Map<String, dynamic>> deleteUser(String token) async {
Map<String, dynamic> cats = {};
String server_url = ConstValues.currentServer();
String url = '${server_url}/api/delete-account/';
//String url = 'http://localhost:8100/api/register/';
final http.Response response = await http.get(
Uri.parse(url),
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Token ${token}'
}
);
if (response.statusCode == 200) {
cats = json.decode(utf8.decode(response.bodyBytes));
}
return cats;
}
static Future<List<dynamic>?> UserDetails(int userid) async {
List<dynamic> cats = [];