Add API_BASE_URL import to multiple Vue components for consistent API endpoint usage
This commit is contained in:
@@ -192,7 +192,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const futureHolidays = ref([])
|
||||
const pastHolidays = ref([])
|
||||
|
||||
@@ -77,7 +77,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const invitations = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -66,7 +66,9 @@ import { ref } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const loading = ref(false)
|
||||
|
||||
|
||||
@@ -88,7 +88,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const watchers = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -115,7 +115,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const availableStates = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -71,7 +71,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const users = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -105,7 +105,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const sickEntries = ref([])
|
||||
const sickTypes = ref([])
|
||||
|
||||
@@ -156,6 +156,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const timefixes = ref([])
|
||||
@@ -224,7 +227,7 @@ function onEntrySelected() {
|
||||
async function loadTimefixes() {
|
||||
try {
|
||||
loading.value = true
|
||||
const response = await fetch('${API_URL}/timefix', {
|
||||
const response = await fetch(`${API_URL}/timefix`, {
|
||||
headers: authStore.getAuthHeaders()
|
||||
})
|
||||
|
||||
@@ -248,7 +251,7 @@ async function createTimefix() {
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
const response = await fetch('${API_URL}/timefix', {
|
||||
const response = await fetch(`${API_URL}/timefix`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
...authStore.getAuthHeaders(),
|
||||
|
||||
@@ -149,7 +149,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const timewishes = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -103,7 +103,9 @@ import { ref, onMounted } from 'vue'
|
||||
import { useAuthStore } from '../stores/authStore'
|
||||
import { useModal } from '../composables/useModal'
|
||||
import Modal from '../components/Modal.vue'
|
||||
import { API_BASE_URL } from '@/config/api'
|
||||
|
||||
const API_URL = API_BASE_URL
|
||||
const authStore = useAuthStore()
|
||||
const vacations = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user