From 5e0eca4b1ef402f6addfd669dbf34e6ca04e14dd Mon Sep 17 00:00:00 2001 From: Martin Araneda Date: Wed, 1 Mar 2023 23:55:56 -0300 Subject: [PATCH] fix api url --- frontend/src/layout/AppTopbar.vue | 2 +- frontend/src/utils/Auth.js | 2 +- frontend/src/views/Chart.vue | 2 +- frontend/src/views/Login.vue | 2 +- frontend/src/views/OsCrud.vue | 2 +- frontend/src/views/UserCrud.vue | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/layout/AppTopbar.vue b/frontend/src/layout/AppTopbar.vue index caf7738..bab5def 100644 --- a/frontend/src/layout/AppTopbar.vue +++ b/frontend/src/layout/AppTopbar.vue @@ -8,7 +8,7 @@ import jwt_decode from 'jwt-decode'; import auth from '../utils/Auth'; const url = new URL(window.location.href); -const api = (url.port == "5173") ? "http://localhost:3001" : "/api"; +const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1"; const { onMenuToggle } = useLayout(); const outsideClickListener = ref(null); const topbarMenuActive = ref(false); diff --git a/frontend/src/utils/Auth.js b/frontend/src/utils/Auth.js index dd0e7cd..d08d5aa 100644 --- a/frontend/src/utils/Auth.js +++ b/frontend/src/utils/Auth.js @@ -13,7 +13,7 @@ var auth = { }, checkToken(redirect = true, callback = null) { const url = new URL(window.location.href); - const api = (url.port == "5173") ? "http://localhost:3001" : "/api"; + const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1"; const config = this.getTokenHeader(); diff --git a/frontend/src/views/Chart.vue b/frontend/src/views/Chart.vue index 6e0212c..dbcfa96 100644 --- a/frontend/src/views/Chart.vue +++ b/frontend/src/views/Chart.vue @@ -25,7 +25,7 @@ const setColorOptions = () => { surfaceBorder = documentStyle.getPropertyValue('--surface-border'); }; const url = new URL(window.location.href); -const api = (url.port == "5173") ? "http://localhost:3001" : "/api"; +const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1"; async function getGames() { diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue index edc5caf..5612753 100644 --- a/frontend/src/views/Login.vue +++ b/frontend/src/views/Login.vue @@ -8,7 +8,7 @@ const password = ref(''); const router = useRouter(); const toast = useToast(); const url = new URL(window.location.href); -const api = (url.port == "5173") ? "http://localhost:3001" : "/api"; +const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1"; async function onLoginClick() { var login = diff --git a/frontend/src/views/OsCrud.vue b/frontend/src/views/OsCrud.vue index 31b13c7..d8fe960 100644 --- a/frontend/src/views/OsCrud.vue +++ b/frontend/src/views/OsCrud.vue @@ -20,7 +20,7 @@ const checkAuth = () => { auth.checkToken(true); }; const url = new URL(window.location.href); -const api = (url.port == "5173") ? "http://localhost:3001" : "/api"; +const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1"; async function showTable() { try { diff --git a/frontend/src/views/UserCrud.vue b/frontend/src/views/UserCrud.vue index 4e39cca..eae5826 100644 --- a/frontend/src/views/UserCrud.vue +++ b/frontend/src/views/UserCrud.vue @@ -20,7 +20,7 @@ const checkAuth = () => { auth.checkToken(true); }; const url = new URL(window.location.href); -const api = (url.port == "5173") ? "http://localhost:3001" : "/api"; +const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1"; async function showTable() { try {