This commit is contained in:
2023-11-17 21:22:26 +02:00
parent 794916b178
commit 821ba9465c
9 changed files with 214 additions and 216 deletions
+4 -26
View File
@@ -1,6 +1,3 @@
import _ from "lodash";
window._ = _;
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
@@ -9,13 +6,14 @@ window._ = _;
import axios from "axios";
window.axios = axios;
export const axiosInstance = axios;
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
window.axios.interceptors.request.use(
function (config) {
let list;
list = document.querySelectorAll(".btn-spinner");
for (var i = 0; i < list.length; ++i) {
for (let i = 0; i < list.length; ++i) {
list[i].classList.add("spinner-on");
list[i].disabled = true;
}
@@ -31,7 +29,7 @@ window.axios.interceptors.response.use(
function (response) {
let list;
list = document.querySelectorAll(".btn-spinner");
for (var i = 0; i < list.length; ++i) {
for (let i = 0; i < list.length; ++i) {
list[i].classList.remove("spinner-on");
list[i].disabled = false;
}
@@ -40,7 +38,7 @@ window.axios.interceptors.response.use(
function (error) {
let list;
list = document.querySelectorAll(".btn-spinner");
for (var i = 0; i < list.length; ++i) {
for (let i = 0; i < list.length; ++i) {
list[i].classList.remove("spinner-on");
list[i].disabled = false;
}
@@ -48,23 +46,3 @@ window.axios.interceptors.response.use(
}
);
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
// import Echo from 'laravel-echo';
// import Pusher from 'pusher-js';
// window.Pusher = Pusher;
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: import.meta.env.VITE_PUSHER_APP_KEY,
// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_CLUSTER}.pusher.com`,
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
// enabledTransports: ['ws', 'wss'],
// });