loader
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
VITE_TEST_VAR=123
|
VITE_TEST_VAR=123
|
||||||
# VITE_SERVER_API=http://192.168.56.1:3000/
|
# VITE_SERVER_API=http://192.168.1.158:3002
|
||||||
VITE_SERVER_API=https://irth.graff.tech/api
|
VITE_SERVER_API=https://irth.graff.tech/api
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
"zustand": "^4.5.2"
|
"zustand": "^4.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.14.8",
|
||||||
"@types/react": "^18.2.66",
|
"@types/react": "^18.2.66",
|
||||||
"@types/react-dom": "^18.2.22",
|
"@types/react-dom": "^18.2.22",
|
||||||
"@types/react-transition-group": "^4.4.10",
|
"@types/react-transition-group": "^4.4.10",
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ const LayoutOptions = () => {
|
|||||||
const zohoToken = localStorage.getItem("ACCESS_TOKEN");
|
const zohoToken = localStorage.getItem("ACCESS_TOKEN");
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
updateAccessToken()
|
if (!zohoToken) {
|
||||||
.then((token) => {
|
updateAccessToken().then((token) => {
|
||||||
if (token) {
|
if (token) {
|
||||||
getFilteredApartments(
|
getFilteredApartments(
|
||||||
token,
|
token,
|
||||||
@@ -81,64 +81,52 @@ const LayoutOptions = () => {
|
|||||||
sortList,
|
sortList,
|
||||||
pageInitial,
|
pageInitial,
|
||||||
perPage
|
perPage
|
||||||
);
|
).then(() => {
|
||||||
|
setIsLoading(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.then(() =>
|
|
||||||
getFilteredApartments(
|
|
||||||
zohoToken,
|
|
||||||
setApartments,
|
|
||||||
roveHomeTypeCheckboxes,
|
|
||||||
apartmentTypeCheckboxes,
|
|
||||||
debouncedSliders,
|
|
||||||
switchers,
|
|
||||||
viewCheckboxes,
|
|
||||||
sortList,
|
|
||||||
pageInitial,
|
|
||||||
perPage
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.finally(() => {
|
|
||||||
setIsLoading(false);
|
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
getFilteredApartments(
|
||||||
|
zohoToken,
|
||||||
|
setApartments,
|
||||||
|
roveHomeTypeCheckboxes,
|
||||||
|
apartmentTypeCheckboxes,
|
||||||
|
debouncedSliders,
|
||||||
|
switchers,
|
||||||
|
viewCheckboxes,
|
||||||
|
sortList,
|
||||||
|
pageInitial,
|
||||||
|
perPage
|
||||||
|
)
|
||||||
|
.catch((error) => {
|
||||||
|
const errorStatus = error.response.status;
|
||||||
|
|
||||||
// getFilteredApartments(
|
if (errorStatus === 401) {
|
||||||
// zohoToken,
|
updateAccessToken().then((token) => {
|
||||||
// setApartments,
|
if (token) {
|
||||||
// roveHomeTypeCheckboxes,
|
getFilteredApartments(
|
||||||
// apartmentTypeCheckboxes,
|
token,
|
||||||
// debouncedSliders,
|
setApartments,
|
||||||
// switchers,
|
roveHomeTypeCheckboxes,
|
||||||
// viewCheckboxes,
|
apartmentTypeCheckboxes,
|
||||||
// sortList,
|
debouncedSliders,
|
||||||
// pageInitial,
|
switchers,
|
||||||
// perPage
|
viewCheckboxes,
|
||||||
// )
|
sortList,
|
||||||
// .catch((error) => {
|
pageInitial,
|
||||||
// const errorStatus = error.response.status;
|
perPage
|
||||||
|
).then(() => {
|
||||||
// if (errorStatus === 401) {
|
setIsLoading(false);
|
||||||
// updateAccessToken().then((token) => {
|
});
|
||||||
// if (token) {
|
}
|
||||||
// getFilteredApartments(
|
});
|
||||||
// token,
|
}
|
||||||
// setApartments,
|
})
|
||||||
// roveHomeTypeCheckboxes,
|
.then(() => {
|
||||||
// apartmentTypeCheckboxes,
|
setIsLoading(false);
|
||||||
// debouncedSliders,
|
});
|
||||||
// switchers,
|
}
|
||||||
// viewCheckboxes,
|
|
||||||
// sortList,
|
|
||||||
// pageInitial,
|
|
||||||
// perPage
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// setIsLoading(false);
|
|
||||||
// });
|
|
||||||
}, [
|
}, [
|
||||||
setApartments,
|
setApartments,
|
||||||
roveHomeTypeCheckboxes,
|
roveHomeTypeCheckboxes,
|
||||||
|
|||||||
+18
-5
@@ -1,7 +1,20 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig, loadEnv } from "vite";
|
||||||
import react from '@vitejs/plugin-react'
|
import react from "@vitejs/plugin-react";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => {
|
||||||
plugins: [react()],
|
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
|
||||||
})
|
|
||||||
|
return {
|
||||||
|
plugins: [react()],
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
"/api": {
|
||||||
|
target: process.env.VITE_SERVER_API,
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|||||||
@@ -709,6 +709,13 @@
|
|||||||
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz"
|
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz"
|
||||||
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||||
|
|
||||||
|
"@types/node@^20.14.8":
|
||||||
|
version "20.14.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.8.tgz#45c26a2a5de26c3534a9504530ddb3b27ce031ac"
|
||||||
|
integrity sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==
|
||||||
|
dependencies:
|
||||||
|
undici-types "~5.26.4"
|
||||||
|
|
||||||
"@types/offscreencanvas@^2019.6.4":
|
"@types/offscreencanvas@^2019.6.4":
|
||||||
version "2019.7.3"
|
version "2019.7.3"
|
||||||
resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz#90267db13f64d6e9ccb5ae3eac92786a7c77a516"
|
resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz#90267db13f64d6e9ccb5ae3eac92786a7c77a516"
|
||||||
@@ -2622,6 +2629,11 @@ ua-parser-js@^1.0.33:
|
|||||||
resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz"
|
resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz"
|
||||||
integrity sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==
|
integrity sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==
|
||||||
|
|
||||||
|
undici-types@~5.26.4:
|
||||||
|
version "5.26.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
|
||||||
|
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
||||||
|
|
||||||
update-browserslist-db@^1.0.13:
|
update-browserslist-db@^1.0.13:
|
||||||
version "1.0.13"
|
version "1.0.13"
|
||||||
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz"
|
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz"
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
PORT=3000
|
PORT=3002
|
||||||
REFRESH_TOKEN=1000.da3146d49fa8a399f0c635e74954ff9c.e010dbb1bb605d7e1aa5bf7fc0521f8b
|
REFRESH_TOKEN=1000.da3146d49fa8a399f0c635e74954ff9c.e010dbb1bb605d7e1aa5bf7fc0521f8b
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
module.exports = {
|
||||||
|
apps: [
|
||||||
|
{
|
||||||
|
name: "irth-server:3002",
|
||||||
|
script: "./dist",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user