Fix distractor_words special=m2m in Directus via eigenen Endpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -323,10 +323,14 @@ export default function GenerateIt() {
|
||||
title="Directus-Schema einmalig konfigurieren (M2M-Relationen)"
|
||||
onClick={async () => {
|
||||
if (!token) return
|
||||
const res = await fetch('/api/setup-schema', { method: 'POST', headers: { Authorization: `Bearer ${token}` } })
|
||||
const d = await res.json()
|
||||
alert(`Setup: ${d.total} Schritte, ${d.failed} Fehler.\nSiehe Konsole für Details.`)
|
||||
console.log('[setup-schema]', d)
|
||||
const h = { Authorization: `Bearer ${token}` }
|
||||
const [r1, r2] = await Promise.all([
|
||||
fetch('/api/setup-schema', { method: 'POST', headers: h }),
|
||||
fetch('/api/fix-distractor-field', { method: 'POST', headers: h }),
|
||||
])
|
||||
const [d1, d2] = await Promise.all([r1.json(), r2.json()])
|
||||
alert(`Setup: ${d1.total} Schritte, ${d1.failed} Fehler\nDistractor-Fix: ${d2.ok ? 'OK' : 'Fehler'}`)
|
||||
console.log('[setup-schema]', d1, '[fix-distractor]', d2)
|
||||
}}
|
||||
>
|
||||
⚙ Schema
|
||||
|
||||
Reference in New Issue
Block a user