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

@@ -175,7 +175,7 @@ export default {
},
async created() {
try {
const eventTypeResponse = await axios.get('http://localhost:3000/api/event-types');
const eventTypeResponse = await axios.get('/event-types');
this.eventTypes = eventTypeResponse.data;
this.selectedEventType = this.eventTypes.find(type => type.id === this.event.eventTypeId) || null;
} catch (error) {
@@ -196,9 +196,9 @@ export default {
payload.dayOfWeek = payload.dayOfWeek.value;
let response;
if (this.eventData.id) {
response = await axios.put(`http://localhost:3000/api/events/${this.eventData.id}`, payload);
response = await axios.put(`/events/${this.eventData.id}`, payload);
} else {
response = await axios.post('http://localhost:3000/api/events', payload);
response = await axios.post('/events', payload);
}
this.$emit('saved', response.data);
} catch (error) {