Loading portal/static/js/components/pieces/Agenda.mjs +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 Loading @@ -40,7 +40,7 @@ export const Agenda = { }, }, m("i.fa-solid.fa-floppy-disk"), "Speichern", agenda.changes.length > 0 ? "Speichern" : "Ohne Änderungen speichern", ), ] : m( Loading portal/static/js/model/Agenda.mjs +16 −3 Changes for portal/static/js/model/Agenda.mjs: 16 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -12,7 +12,13 @@ export class Agenda { return getKey() ? { Authorization: `Bearer ${getKey().secret}` } : {} } async fetch() { get changes() { return this.items.filter(it => it.taiga && it.taiga.status !== 42) } async fetch(force) { if(this.items && !force) return try { this.items = await m.request({ method: "GET", Loading @@ -30,13 +36,20 @@ export class Agenda { } async save() { // TODO Somehow handle error? try { if(this.changes.length === 0) return this.items = await m.request({ method: "PATCH", url: this.url, headers: this.#headers, body: this.items, body: this.changes }) } catch (e) { // TODO Handle error better alert("Beim Speichern ist ein Fehler aufgetreten.") throw e } } } Loading Loading
portal/static/js/components/pieces/Agenda.mjs +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 Loading @@ -40,7 +40,7 @@ export const Agenda = { }, }, m("i.fa-solid.fa-floppy-disk"), "Speichern", agenda.changes.length > 0 ? "Speichern" : "Ohne Änderungen speichern", ), ] : m( Loading
portal/static/js/model/Agenda.mjs +16 −3 Changes for portal/static/js/model/Agenda.mjs: 16 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -12,7 +12,13 @@ export class Agenda { return getKey() ? { Authorization: `Bearer ${getKey().secret}` } : {} } async fetch() { get changes() { return this.items.filter(it => it.taiga && it.taiga.status !== 42) } async fetch(force) { if(this.items && !force) return try { this.items = await m.request({ method: "GET", Loading @@ -30,13 +36,20 @@ export class Agenda { } async save() { // TODO Somehow handle error? try { if(this.changes.length === 0) return this.items = await m.request({ method: "PATCH", url: this.url, headers: this.#headers, body: this.items, body: this.changes }) } catch (e) { // TODO Handle error better alert("Beim Speichern ist ein Fehler aufgetreten.") throw e } } } Loading