diff --git a/src/App.vue b/src/App.vue index 4a4eb17..10578da 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,8 +5,8 @@ \ No newline at end of file diff --git a/src/api/index.ts b/src/api/index.ts index e51e71d..ded8246 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,16 +1,16 @@ -import axios from 'axios'; -import { setupCache } from 'axios-cache-adapter' -import OfflineHelper from '@/offline-helper' +import axios from "axios"; +import { setupCache } from "axios-cache-adapter" +import OfflineHelper from "@/offline-helper" import emitter from "@/event-bus" -import store from '@/store'; -import { StatusCodes } from 'http-status-codes'; -import router from '@/router' +import store from "@/store"; +import { StatusCodes } from "http-status-codes"; +import router from "@/router" axios.interceptors.request.use((config: any) => { - const token = store.getters['user/getUserToken']; + const token = store.getters["user/getUserToken"]; if (token) { - config.headers.Authorization = 'Bearer ' + token; - config.headers['Content-Type'] = 'application/json'; + config.headers.Authorization = "Bearer " + token; + config.headers["Content-Type"] = "application/json"; } return config; }); @@ -30,7 +30,7 @@ axios.interceptors.response.use(function (response) { const { status } = error.response; if (status === StatusCodes.UNAUTHORIZED) { store.dispatch("user/logout"); - router.push('/login') + router.push("/login") } } // Any status codes that falls outside the range of 2xx cause this function to trigger @@ -48,8 +48,8 @@ const axiosCache = setupCache({ * Generic method to call APIs * * @param {string} url - API Url - * @param {string=} method - 'GET', 'PUT', 'POST', 'DELETE , and 'PATCH' - * @param {any} [data] - Optional: `data` is the data to be sent as the request body. Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + * @param {string=} method - "GET", "PUT", "POST", "DELETE , and "PATCH" + * @param {any} [data] - Optional: `data` is the data to be sent as the request body. Only applicable for request methods "PUT", "POST", "DELETE , and "PATCH" * When no `transformRequest` is set, must be of one of the following types: * - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams * - Browser only: FormData, File, Blob @@ -68,7 +68,7 @@ const api = async (customConfig: any) => { params: customConfig.params } - const baseURL = store.getters['user/getInstanceUrl']; + const baseURL = store.getters["user/getInstanceUrl"]; if (baseURL) config.baseURL = `https://${baseURL}.hotwax.io/api/`; if(customConfig.cache) config.adapter = axiosCache.adapter; const networkStatus = await OfflineHelper.getNetworkStatus(); diff --git a/src/components/AddActionModal.vue b/src/components/AddActionModal.vue index af4cc0e..f61796e 100644 --- a/src/components/AddActionModal.vue +++ b/src/components/AddActionModal.vue @@ -44,9 +44,9 @@ import { IonTitle, IonToolbar, modalController, -} from '@ionic/vue'; -import { defineComponent } from 'vue'; -import { closeOutline } from 'ionicons/icons'; +} from "@ionic/vue"; +import { defineComponent } from "vue"; +import { closeOutline } from "ionicons/icons"; import { useStore } from "@/store"; export default defineComponent({ diff --git a/src/components/Image.vue b/src/components/Image.vue index 9d7c998..5c52bab 100644 --- a/src/components/Image.vue +++ b/src/components/Image.vue @@ -9,7 +9,7 @@ import { IonSkeletonText } from '@ionic/vue' export default defineComponent({ name: "Image", - props: ['src'], + props: ["src"], components: { IonSkeletonText }, @@ -26,8 +26,8 @@ export default defineComponent({ }, data() { return { - resourceUrl: '', - imageUrl: '' + resourceUrl: "", + imageUrl: "" } }, methods: { @@ -45,10 +45,10 @@ export default defineComponent({ }, setImageUrl() { if (this.src) { - if (this.src.indexOf('assets/') != -1) { + if (this.src.indexOf("assets/") != -1) { // Assign directly in case of assets this.imageUrl = this.src; - } else if (this.src.startsWith('http')) { + } else if (this.src.startsWith("http")) { // If starts with http, it is web url check for existence and assign this.checkIfImageExists(this.src).then(() => { this.imageUrl = this.src; diff --git a/src/components/Logo.vue b/src/components/Logo.vue index 2a2b29b..a6a2834 100644 --- a/src/components/Logo.vue +++ b/src/components/Logo.vue @@ -6,7 +6,7 @@ diff --git a/src/components/RuleConfiguration.vue b/src/components/RuleConfiguration.vue index 9cf93f1..9b75c55 100644 --- a/src/components/RuleConfiguration.vue +++ b/src/components/RuleConfiguration.vue @@ -70,16 +70,16 @@