diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index d9ffd0ce..d719586f 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -25,6 +25,7 @@ class APIError { } APIException _throwAPIException(Response response) { + print(response.statusCode); switch (response.statusCode) { case 200: APIError? apiError; diff --git a/lib/api/user_api_client.dart b/lib/api/user_api_client.dart index b11b8887..c3d47fdd 100644 --- a/lib/api/user_api_client.dart +++ b/lib/api/user_api_client.dart @@ -25,6 +25,9 @@ class UserApiClient { }, "${URLs.host1}${URLs.login}", await user.toLoginJson(), //body + headers: { + 'Content-Type': 'application/json; charset=utf-8', + }, ); } diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index cd82f7dd..ec450674 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -1,10 +1,10 @@ class URLs { URLs._(); static const host2 = "http://194.163.164.213/atoms/api"; - static const host1 = "https://atoms.hmg.com/api"; + static const host1 = "https://atomsuat.hmg.com"; // API Routes - static const login = "/handle/user/login"; // post + static const login = "/mobile/MobileAuth/Login"; // post static const register = "/handle/create/user"; // post static const updateProfile = "/update/user/profile"; // post static const getHospitals = "/handle/return/all/clients"; // get diff --git a/lib/models/user.dart b/lib/models/user.dart index a52333dd..adb33a7c 100644 --- a/lib/models/user.dart +++ b/lib/models/user.dart @@ -23,8 +23,8 @@ class User { if (FirebaseNotificationManger.token == null) await FirebaseNotificationManger.getToken(); return { "username": userName, - "pass": password, - "firebase_token": FirebaseNotificationManger.token ?? "", + "password": password, + "fireBaseToken": FirebaseNotificationManger.token ?? "", }; }