NEW: Add user and business count to about MIH
This commit is contained in:
@@ -9,6 +9,21 @@ import '../mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
class MihBusinessDetailsServices {
|
||||
Future<int> fetchBusinessCount() async {
|
||||
var response = await http.get(
|
||||
Uri.parse("${AppEnviroment.baseApiUrl}/business/count/"),
|
||||
headers: <String, String>{
|
||||
"Content-Type": "application/json; charset=UTF-8"
|
||||
},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
var jsonBody = jsonDecode(response.body);
|
||||
return jsonBody['count'];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<String>> fetchAllBusinessTypes() async {
|
||||
var response = await http.get(
|
||||
Uri.parse("${AppEnviroment.baseApiUrl}/business/types/"),
|
||||
|
||||
@@ -33,6 +33,21 @@ class MihUserServices {
|
||||
}
|
||||
}
|
||||
|
||||
Future<int> fetchUserCount() async {
|
||||
var response = await http.get(
|
||||
Uri.parse("${AppEnviroment.baseApiUrl}/users/count/"),
|
||||
headers: <String, String>{
|
||||
"Content-Type": "application/json; charset=UTF-8"
|
||||
},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
var jsonBody = jsonDecode(response.body);
|
||||
return jsonBody['count'];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> createUser(
|
||||
String email,
|
||||
String app_id,
|
||||
|
||||
Reference in New Issue
Block a user