Add HTTP client wrapper and upgrade Axios to v1 (#594)

* refactor: add HTTP client wrapper and upgrade axios to v1

Introduce a thin HTTP wrapper (resources/scripts/http) that centralizes
axios configuration, interceptors, and auth header injection. All 43
files now import from the wrapper instead of axios directly, making
future library swaps a single-file change. Upgrade axios from 0.30.0
to 1.14.0.

* fix: restore window.Ls assignment removed during axios refactor

company.js uses window.Ls.set() to persist selected company,
which broke after the axios plugin (that set window.Ls) was deleted.
This commit is contained in:
Darko Gjorgjijoski
2026-04-02 15:08:23 +02:00
committed by GitHub
parent a38f09cf7b
commit 691178857f
46 changed files with 637 additions and 394 deletions

View File

@@ -58,7 +58,7 @@ import useVuelidate from '@vuelidate/core'
import { required, email, minLength, sameAs } from '@vuelidate/validators'
import { useNotificationStore } from '@/scripts/stores/notification'
import { useRoute, useRouter } from 'vue-router'
import axios from 'axios'
import http from '@/scripts/http'
import { useI18n } from 'vue-i18n'
import { handleError } from '@/scripts/helpers/error-handling'
@@ -141,7 +141,7 @@ async function onSubmit(e) {
token: route.params.token,
}
isLoading.value = true
let res = await axios.post('/api/v1/auth/reset/password', data)
let res = await http.post('/api/v1/auth/reset/password', data)
isLoading.value = false
if (res.data) {
notificationStore.showNotification({