Skip to content

Commit 3200f21

Browse files
Change json placeHolder to fakerestapi
1 parent 0d3abbf commit 3200f21

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

app.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const envConfig = (MY_ENVIRONMENT) => {
22
if (MY_ENVIRONMENT === 'production') {
33
return {
44
/* your production config */
5-
HOSTURL: 'https://jsonplaceholder2.typicode.com',
5+
HOSTURL: 'https://fakerestapi.azurewebsites.net',
66
};
77
}
88
return {
9-
HOSTURL: 'https://jsonplaceholder.typicode.com',
9+
HOSTURL: 'https://fakerestapi.azurewebsites.net',
1010
};
1111
};
1212

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"main": "index.js",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"scripts": {
55
"android": "react-native run-android",
66
"ios": "react-native run-ios",

source/components/Screens/Users/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Users = () => {
2727
) : (
2828
<View>
2929
{allUsersData?.map((item) => (
30-
<Text key={item.id}>{item?.name}</Text>
30+
<Text key={item.id}>{item?.userName}</Text>
3131
))}
3232
</View>
3333
)}

source/constants/endpoints.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export default {
88
`${HOSTURL}/configuration/api/v1/configurations`,
99
},
1010
USERS: {
11-
GET_ALL_USERS_SERVICE: () => `${HOSTURL}/users`,
11+
GET_ALL_USERS_SERVICE: () => `${HOSTURL}/api/v1/Users`,
1212
},
1313
};

source/store/request.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,17 @@ instanceAxios.interceptors.request.use(
4040
instanceAxios.interceptors.response.use(
4141
(response) => response,
4242
(error) => {
43-
const originalRequest = error.config;
44-
43+
const originalRequest = error?.config;
4544
if (
46-
error.response.status === 401 &&
45+
error?.response?.status === 401 &&
4746
originalRequest.url === 'http://13.232.130.60:8081/v1/auth/token'
4847
) {
4948
// router.push('/login');
5049
return Promise.reject(error);
5150
}
5251

5352
// eslint-disable-next-line no-underscore-dangle
54-
if (error.response.status === 401 && !originalRequest._retry) {
53+
if (error?.response?.status === 401 && !originalRequest._retry) {
5554
// eslint-disable-next-line no-underscore-dangle
5655
originalRequest._retry = true;
5756
const refreshToken = localStorageService.getRefreshToken();

0 commit comments

Comments
 (0)