Fix template literals in multiple Vue components for API URL construction to ensure correct endpoint formatting.

This commit is contained in:
Torsten Schulz (local)
2025-10-20 08:47:05 +02:00
parent 2e3a1a9e99
commit 52712db78d
10 changed files with 22 additions and 20 deletions

View File

@@ -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',

View File

@@ -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',

View File

@@ -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`
}
</script>

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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}`
}

View File

@@ -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',

View File

@@ -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',

View File

@@ -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(),