Backend-Adresse aus .env file beziehen

This commit is contained in:
Torsten Schulz
2024-06-15 23:29:41 +02:00
parent 61653ff407
commit 4e371f88b1
23 changed files with 568 additions and 83 deletions

View File

@@ -90,7 +90,7 @@ export default {
formatDate,
async fetchWorships() {
try {
const response = await axios.get('http://localhost:3000/api/worships');
const response = await axios.get('/worships');
this.worships = response.data;
} catch (error) {
console.error('Fehler beim Abrufen der Gottesdienste:', error);
@@ -98,7 +98,7 @@ export default {
},
async fetchEventPlaces() {
try {
const response = await axios.get('http://localhost:3000/api/event-places');
const response = await axios.get('/event-places');
this.eventPlaces = response.data;
} catch (error) {
console.error('Fehler beim Abrufen der Veranstaltungsorte:', error);
@@ -112,9 +112,9 @@ export default {
};
if (this.editMode) {
await axios.put(`http://localhost:3000/api/worships/${this.editId}`, payload);
await axios.put(`/worships/${this.editId}`, payload);
} else {
await axios.post('http://localhost:3000/api/worships', payload);
await axios.post('/worships', payload);
}
this.resetForm();
@@ -131,7 +131,7 @@ export default {
},
async deleteWorship(id) {
try {
await axios.delete(`http://localhost:3000/api/worships/${id}`);
await axios.delete(`/worships/${id}`);
await this.fetchWorships();
} catch (error) {
console.error('Fehler beim Löschen des Gottesdienstes:', error);