Fixed edit worship page

This commit is contained in:
Torsten Schulz
2024-07-12 13:04:03 +02:00
parent 2719bd3a3b
commit bd9de0102a

View File

@@ -94,7 +94,7 @@ export default {
async fetchWorships() { async fetchWorships() {
try { try {
const response = await axios.get('/worships'); const response = await axios.get('/worships');
this.worships = response.data; this.worships = response.data.reverse();
} catch (error) { } catch (error) {
console.error('Fehler beim Abrufen der Gottesdienste:', error); console.error('Fehler beim Abrufen der Gottesdienste:', error);
} }
@@ -128,6 +128,9 @@ export default {
}, },
editWorship(worship) { editWorship(worship) {
this.worshipData = { ...worship }; this.worshipData = { ...worship };
this.worshipData.date = formatDate(worship.date).split(".").reverse().join("-");
this.worshipData.time = formatTime(worship.time);
console.log(this.worshipData);
this.selectedEventPlace = this.eventPlaces.find(ep => ep.id === worship.eventPlaceId); this.selectedEventPlace = this.eventPlaces.find(ep => ep.id === worship.eventPlaceId);
this.editMode = true; this.editMode = true;
this.editId = worship.id; this.editId = worship.id;