.env
This commit is contained in:
+2
-1
@@ -1,2 +1,3 @@
|
||||
VITE_TEST_VAR=123
|
||||
VITE_SERVER_API=http://192.168.56.1:3000
|
||||
# VITE_SERVER_API=http://192.168.56.1:3000/
|
||||
VITE_SERVER_API=https://irth.graff.tech/api
|
||||
@@ -22,7 +22,6 @@ import SearchLoader from "./SearchLoader";
|
||||
const LayoutOptions = () => {
|
||||
const { apartments, setApartments } = useApartments();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
console.log("first", import.meta.env.VITE_TEST_VAR);
|
||||
|
||||
const { setModal } = useModal();
|
||||
const {
|
||||
@@ -68,43 +67,78 @@ const LayoutOptions = () => {
|
||||
const zohoToken = localStorage.getItem("ACCESS_TOKEN");
|
||||
setIsLoading(true);
|
||||
|
||||
getFilteredApartments(
|
||||
zohoToken,
|
||||
setApartments,
|
||||
roveHomeTypeCheckboxes,
|
||||
apartmentTypeCheckboxes,
|
||||
debouncedSliders,
|
||||
switchers,
|
||||
viewCheckboxes,
|
||||
sortList,
|
||||
pageInitial,
|
||||
perPage
|
||||
)
|
||||
.catch((error) => {
|
||||
const errorStatus = error.response.status;
|
||||
|
||||
if (errorStatus === 401) {
|
||||
updateAccessToken().then((token) => {
|
||||
if (token) {
|
||||
getFilteredApartments(
|
||||
token,
|
||||
setApartments,
|
||||
roveHomeTypeCheckboxes,
|
||||
apartmentTypeCheckboxes,
|
||||
debouncedSliders,
|
||||
switchers,
|
||||
viewCheckboxes,
|
||||
sortList,
|
||||
pageInitial,
|
||||
perPage
|
||||
);
|
||||
}
|
||||
});
|
||||
updateAccessToken()
|
||||
.then((token) => {
|
||||
if (token) {
|
||||
getFilteredApartments(
|
||||
token,
|
||||
setApartments,
|
||||
roveHomeTypeCheckboxes,
|
||||
apartmentTypeCheckboxes,
|
||||
debouncedSliders,
|
||||
switchers,
|
||||
viewCheckboxes,
|
||||
sortList,
|
||||
pageInitial,
|
||||
perPage
|
||||
);
|
||||
}
|
||||
})
|
||||
.then(() =>
|
||||
getFilteredApartments(
|
||||
zohoToken,
|
||||
setApartments,
|
||||
roveHomeTypeCheckboxes,
|
||||
apartmentTypeCheckboxes,
|
||||
debouncedSliders,
|
||||
switchers,
|
||||
viewCheckboxes,
|
||||
sortList,
|
||||
pageInitial,
|
||||
perPage
|
||||
)
|
||||
)
|
||||
.finally(() => {
|
||||
setIsLoading(false);
|
||||
});
|
||||
|
||||
// getFilteredApartments(
|
||||
// zohoToken,
|
||||
// setApartments,
|
||||
// roveHomeTypeCheckboxes,
|
||||
// apartmentTypeCheckboxes,
|
||||
// debouncedSliders,
|
||||
// switchers,
|
||||
// viewCheckboxes,
|
||||
// sortList,
|
||||
// pageInitial,
|
||||
// perPage
|
||||
// )
|
||||
// .catch((error) => {
|
||||
// const errorStatus = error.response.status;
|
||||
|
||||
// if (errorStatus === 401) {
|
||||
// updateAccessToken().then((token) => {
|
||||
// if (token) {
|
||||
// getFilteredApartments(
|
||||
// token,
|
||||
// setApartments,
|
||||
// roveHomeTypeCheckboxes,
|
||||
// apartmentTypeCheckboxes,
|
||||
// debouncedSliders,
|
||||
// switchers,
|
||||
// viewCheckboxes,
|
||||
// sortList,
|
||||
// pageInitial,
|
||||
// perPage
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
// .finally(() => {
|
||||
// setIsLoading(false);
|
||||
// });
|
||||
}, [
|
||||
setApartments,
|
||||
roveHomeTypeCheckboxes,
|
||||
|
||||
Reference in New Issue
Block a user