Verified Commit c24ccd81 authored by Jakob Moser's avatar Jakob Moser
Browse files

Show specific error message in agenda on 401

Closes #8
parent a58b1be5
Loading
Loading
Loading
Loading
Loading
+7 −2
Changes for portal/static/js/components/pages/Fachschaftssitzung.mjs: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -7,9 +7,14 @@ const items = {
    async fetch() {
        try {
            this.all = await m.request("/api/v0/agendas/-/items")
        } catch {
        } catch (e) {
            if (e.code === 401) {
                this.message =
                    "Melde dich an Portal an, um die Tagesordnung anzuzeigen."
            } else {
                this.message = "Die Tagesordnung konnte nicht geladen werden."
            }
        }
    },
}

@@ -24,7 +29,7 @@ export const Fachschaftssitzung = {
        return m(Base, [
            m(Agenda, {
                items: items.all?.map(item => item.name),
                message: items.message
                message: items.message,
            }),
        ])
    },