Backend-Adresse aus .env file beziehen
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user