Implement environment variable setup for frontend; create .env.production and .env.development files if they don't exist, and update API URLs in frontend components to use dynamic API_BASE_URL for improved configuration management.
This commit is contained in:
@@ -212,7 +212,7 @@ const form = ref({
|
||||
// Lade alle Bundesländer
|
||||
async function loadStates() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3010/api/holidays/states', {
|
||||
const response = await fetch('${API_URL}/holidays/states', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${authStore.token}`
|
||||
}
|
||||
@@ -233,7 +233,7 @@ async function loadStates() {
|
||||
async function loadHolidays() {
|
||||
try {
|
||||
loading.value = true
|
||||
const response = await fetch('http://localhost:3010/api/holidays', {
|
||||
const response = await fetch('${API_URL}/holidays', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${authStore.token}`
|
||||
}
|
||||
@@ -276,7 +276,7 @@ async function createHoliday() {
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
const response = await fetch('http://localhost:3010/api/holidays', {
|
||||
const response = await fetch('${API_URL}/holidays', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -318,7 +318,7 @@ async function deleteHoliday(id) {
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
const response = await fetch(`http://localhost:3010/api/holidays/${id}`, {
|
||||
const response = await fetch(`${API_URL}/holidays/${id}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Authorization': `Bearer ${authStore.token}`
|
||||
|
||||
Reference in New Issue
Block a user