From b8e253e685bd2d4756a6c2a507d2c7052fda578b Mon Sep 17 00:00:00 2001 From: zaid_daoud Date: Mon, 27 Mar 2023 10:37:16 +0300 Subject: [PATCH] Changing The API's --- lib/api/api_client.dart | 1 + lib/api/user_api_client.dart | 3 +++ lib/controllers/api_routes/urls.dart | 4 ++-- lib/models/user.dart | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) 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 ?? "", }; }