Terminplaner: im Abo-Modell Einschalten statt Bestellen, ohne Häkchen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
364ded1662
commit
b6f70a502a
3 files changed
+119
-7
No files matched your search
+5
-2
@@ -52,14 +52,14 @@ const istBestellt = (zustand) => zustand === 'ordered' || zustand === 'setup'
|
||||
// Entwurf: Funktionsdokument im Zustand Aus mit siteKey (wie die Kachel in funktionen.js)
|
||||
const hatEntwurf = (projekt) => zustandVon(projekt) === 'off' && Boolean(projekt?.features?.termine?.siteKey)
|
||||
|
||||
export async function initTermine(root, { projectId } = {}) {
|
||||
export async function initTermine(root, { projectId, einschalten } = {}) {
|
||||
if (!root) return
|
||||
const rueckkehr = leseRueckkehr()
|
||||
const wunsch = rueckkehr.projekt || projectId || root.dataset.wunschProjekt || '' // die Kachel in Funktionen legt ihr Projekt hier ab
|
||||
delete root.dataset.wunschProjekt
|
||||
if (wunsch) auswahl.projectId = wunsch
|
||||
const { projects = [], termine, modell } = await request('/api/funktionen')
|
||||
const s = { root, projects, termine: termine || null, modell, projekt: null, daten: null, tag: heuteBerlin(), nurLesen: false, lauf: 0, buehne: null, meldungEl: null, danke: false }
|
||||
const s = { root, projects, termine: termine || null, modell, projekt: null, daten: null, tag: heuteBerlin(), nurLesen: false, lauf: 0, buehne: null, meldungEl: null, danke: false, einschalten }
|
||||
S = s
|
||||
if (!termine?.verfuegbar) {
|
||||
keineReiter(s)
|
||||
@@ -259,6 +259,7 @@ async function zeigeBestellung(s, { zustand, aktuell, bestellformular, meldung }
|
||||
einrichtung: s.termine?.einrichtung,
|
||||
danke,
|
||||
kundenansicht: s.daten.kundenansicht === true,
|
||||
modell: s.modell,
|
||||
meldung: zustand === 'ordered' && meldung ? meldung.text : '', // die Meldung gilt nur, solange die Bestellung noch offen ist
|
||||
}, { weiter: (fall) => ladeNeu(s, { bestellformular: fall?.bestellen === true, meldung: fall?.meldung ? { text: fall.meldung } : null }) })
|
||||
}
|
||||
@@ -339,6 +340,8 @@ export function baueCtx(s, { projekt, aktuell, hinweise = () => {}, zumReiter =
|
||||
nurLesen: s.nurLesen,
|
||||
auswahl,
|
||||
aktuell,
|
||||
einschalten: s.einschalten, // Ablauf des Einschaltens im Abo-Modell (Init-Option der Hülle), der Fragebogen mountet ihn im letzten Schritt
|
||||
fertig: () => ladeNeu(s), // nach dem Einschalten: Ansicht neu zeichnen
|
||||
api: {
|
||||
get: (pfad, query = {}) => request(`/api/termine${pfad}?${new URLSearchParams({ projectId, ...query })}`),
|
||||
send: (method, pfad, body = {}) => (method === 'DELETE'
|
||||
|
||||
Reference in new issue
Block a user