diff --git a/frontend/src/views/Holidays.vue b/frontend/src/views/Holidays.vue index 638e665..1dfc39e 100644 --- a/frontend/src/views/Holidays.vue +++ b/frontend/src/views/Holidays.vue @@ -214,7 +214,7 @@ const form = ref({ // Lade alle Bundesländer async function loadStates() { try { - const response = await fetch('${API_URL}/holidays/states', { + const response = await fetch(`${API_URL}/holidays/states`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -235,7 +235,7 @@ async function loadStates() { async function loadHolidays() { try { loading.value = true - const response = await fetch('${API_URL}/holidays', { + const response = await fetch(`${API_URL}/holidays`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -278,7 +278,7 @@ async function createHoliday() { try { loading.value = true - const response = await fetch('${API_URL}/holidays', { + const response = await fetch(`${API_URL}/holidays`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/Invite.vue b/frontend/src/views/Invite.vue index 3d6e715..a49f502 100644 --- a/frontend/src/views/Invite.vue +++ b/frontend/src/views/Invite.vue @@ -93,7 +93,7 @@ const form = ref({ // Lade alle Einladungen async function loadInvitations() { try { - const response = await fetch('${API_URL}/invite', { + const response = await fetch(`${API_URL}/invite`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -118,7 +118,7 @@ async function sendInvite() { try { loading.value = true - const response = await fetch('${API_URL}/invite', { + const response = await fetch(`${API_URL}/invite`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue index 0e12f86..6712693 100644 --- a/frontend/src/views/Login.vue +++ b/frontend/src/views/Login.vue @@ -114,7 +114,9 @@ import { ref } from 'vue' import { useRouter } from 'vue-router' import { useAuthStore } from '../stores/authStore' +import { API_BASE_URL } from '@/config/api' +const API_URL = API_BASE_URL const router = useRouter() const authStore = useAuthStore() @@ -158,7 +160,7 @@ const handleLogin = async () => { const handleGoogleLogin = () => { // Redirect zu Google OAuth - window.location.href = '${API_URL}/auth/google' + window.location.href = `${API_URL}/auth/google` } diff --git a/frontend/src/views/PasswordChange.vue b/frontend/src/views/PasswordChange.vue index 861c862..cc929ca 100644 --- a/frontend/src/views/PasswordChange.vue +++ b/frontend/src/views/PasswordChange.vue @@ -94,7 +94,7 @@ async function changePassword() { try { loading.value = true - const response = await fetch('${API_URL}/password', { + const response = await fetch(`${API_URL}/password`, { method: 'PUT', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/Permissions.vue b/frontend/src/views/Permissions.vue index 9a101ff..c404575 100644 --- a/frontend/src/views/Permissions.vue +++ b/frontend/src/views/Permissions.vue @@ -104,7 +104,7 @@ const form = ref({ // Lade alle Watcher async function loadWatchers() { try { - const response = await fetch('${API_URL}/watcher', { + const response = await fetch(`${API_URL}/watcher`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -130,7 +130,7 @@ async function addWatcher() { try { loading.value = true - const response = await fetch('${API_URL}/watcher', { + const response = await fetch(`${API_URL}/watcher`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/Profile.vue b/frontend/src/views/Profile.vue index 5516fc9..bf20aea 100644 --- a/frontend/src/views/Profile.vue +++ b/frontend/src/views/Profile.vue @@ -137,7 +137,7 @@ const form = ref({ async function loadProfile() { try { loading.value = true - const response = await fetch('${API_URL}/profile', { + const response = await fetch(`${API_URL}/profile`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -167,7 +167,7 @@ async function loadProfile() { // Lade Bundesländer async function loadStates() { try { - const response = await fetch('${API_URL}/profile/states', { + const response = await fetch(`${API_URL}/profile/states`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -187,7 +187,7 @@ async function loadStates() { async function saveProfile() { try { loading.value = true - const response = await fetch('${API_URL}/profile', { + const response = await fetch(`${API_URL}/profile`, { method: 'PUT', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/Roles.vue b/frontend/src/views/Roles.vue index cc4c459..9203dde 100644 --- a/frontend/src/views/Roles.vue +++ b/frontend/src/views/Roles.vue @@ -84,7 +84,7 @@ const { showModal, modalConfig, alert, confirm, onConfirm, onCancel } = useModal async function loadUsers() { try { loading.value = true - const response = await fetch('${API_URL}/roles/users', { + const response = await fetch(`${API_URL}/roles/users`, { headers: { 'Authorization': `Bearer ${authStore.token}` } diff --git a/frontend/src/views/Sick.vue b/frontend/src/views/Sick.vue index 8fd606d..62508d4 100644 --- a/frontend/src/views/Sick.vue +++ b/frontend/src/views/Sick.vue @@ -125,7 +125,7 @@ const form = ref({ async function loadSickEntries() { try { loading.value = true - const response = await fetch('${API_URL}/sick', { + const response = await fetch(`${API_URL}/sick`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -147,7 +147,7 @@ async function loadSickEntries() { // Lade alle Krankheitstypen async function loadSickTypes() { try { - const response = await fetch('${API_URL}/sick/types', { + const response = await fetch(`${API_URL}/sick/types`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -173,7 +173,7 @@ async function createSick() { try { loading.value = true - const response = await fetch('${API_URL}/sick', { + const response = await fetch(`${API_URL}/sick`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/Timewish.vue b/frontend/src/views/Timewish.vue index d8367f5..61cae29 100644 --- a/frontend/src/views/Timewish.vue +++ b/frontend/src/views/Timewish.vue @@ -179,7 +179,7 @@ function onWishtypeChange() { async function loadTimewishes() { try { loading.value = true - const response = await fetch('${API_URL}/timewish', { + const response = await fetch(`${API_URL}/timewish`, { headers: { 'Authorization': `Bearer ${authStore.token}` } @@ -207,7 +207,7 @@ async function createTimewish() { try { loading.value = true - const response = await fetch('${API_URL}/timewish', { + const response = await fetch(`${API_URL}/timewish`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/views/Vacation.vue b/frontend/src/views/Vacation.vue index 7c71f3c..bac471c 100644 --- a/frontend/src/views/Vacation.vue +++ b/frontend/src/views/Vacation.vue @@ -137,7 +137,7 @@ function onStartDateChange() { async function loadVacations() { try { loading.value = true - const response = await fetch('${API_URL}/vacation', { + const response = await fetch(`${API_URL}/vacation`, { headers: authStore.getAuthHeaders() }) @@ -161,7 +161,7 @@ async function createVacation() { try { loading.value = true - const response = await fetch('${API_URL}/vacation', { + const response = await fetch(`${API_URL}/vacation`, { method: 'POST', headers: { ...authStore.getAuthHeaders(),