Changing The API's

merge-requests/17/head
zaid_daoud 3 years ago
parent fe468aa254
commit b8e253e685

@ -25,6 +25,7 @@ class APIError {
} }
APIException _throwAPIException(Response response) { APIException _throwAPIException(Response response) {
print(response.statusCode);
switch (response.statusCode) { switch (response.statusCode) {
case 200: case 200:
APIError? apiError; APIError? apiError;

@ -25,6 +25,9 @@ class UserApiClient {
}, },
"${URLs.host1}${URLs.login}", "${URLs.host1}${URLs.login}",
await user.toLoginJson(), //body await user.toLoginJson(), //body
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
); );
} }

@ -1,10 +1,10 @@
class URLs { class URLs {
URLs._(); URLs._();
static const host2 = "http://194.163.164.213/atoms/api"; 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 // 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 register = "/handle/create/user"; // post
static const updateProfile = "/update/user/profile"; // post static const updateProfile = "/update/user/profile"; // post
static const getHospitals = "/handle/return/all/clients"; // get static const getHospitals = "/handle/return/all/clients"; // get

@ -23,8 +23,8 @@ class User {
if (FirebaseNotificationManger.token == null) await FirebaseNotificationManger.getToken(); if (FirebaseNotificationManger.token == null) await FirebaseNotificationManger.getToken();
return { return {
"username": userName, "username": userName,
"pass": password, "password": password,
"firebase_token": FirebaseNotificationManger.token ?? "", "fireBaseToken": FirebaseNotificationManger.token ?? "",
}; };
} }

Loading…
Cancel
Save