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

Use key to get agenda items

parent d68bafd0
Loading
Loading
Loading
Loading
Loading
+10 −1
Changes for portal/static/js/components/pages/Fachschaftssitzung.mjs: 10 added lines, 1 removed line.
Original line number Diff line number Diff line
import { Base } from "./Base.mjs"
import { Agenda } from "../pieces/Agenda.mjs"
import { getKey } from "../../account.mjs"

const items = {
    all: null,
    message: "Wird geladen...",
    async fetch() {
        try {
            this.all = await m.request("/api/v0/agendas/-/items")
            this.all = await m.request({
                method: "GET",
                url: "/api/v0/agendas/-/items",
                headers: getKey()
                    ? {
                          Authorization: `Bearer ${getKey().secret}`,
                      }
                    : {},
            })
        } catch (e) {
            if (e.code === 401) {
                this.message =