Verified Commit 3e7a82e5 authored by Jakob Moser's avatar Jakob Moser
Browse files

Add message on /agenda/-/items load error

Closes #13
parent 63f1104c
Loading
Loading
Loading
Loading
+6 −0
Changes for portal/static/js/components/pages/Fachschaftssitzung.mjs: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,8 +3,13 @@ import { Agenda } from "../pieces/Agenda.mjs"

const items = {
    all: null,
    message: "Wird geladen...",
    async fetch() {
        try {
            this.all = await m.request("/api/v0/agendas/-/items")
        } catch {
            this.message = "Die Tagesordnung konnte nicht geladen werden."
        }
    },
}

@@ -19,6 +24,7 @@ export const Fachschaftssitzung = {
        return m(Base, [
            m(Agenda, {
                items: items.all?.map(item => item.name),
                message: items.message
            }),
        ])
    },
+1 −1
Changes for portal/static/js/components/pieces/Agenda.mjs: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ export const Agenda = {
                          "ol",
                          vnode.attrs.items.map(item => m("li", item)),
                      )
                    : m("span.message", "Wird geladen..."),
                    : m("span.message", vnode.attrs.message),
            ]),
            m(
                "a.edit",