feat: object words in left sidebar + suggestions in pair form
- Backend: GET /api/directus/db-objects/<id>/words via db_objects_db_words - GenerateIt: load objectWords on object select, show as chips in left sidebar - PairForm: show object words as clickable suggestion chips above word input (click to add, greyed out if already added) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -454,6 +454,15 @@ export async function createDbPair(
|
||||
return data
|
||||
}
|
||||
|
||||
export async function getDbObjectWords(objectId: string, token: string): Promise<DbWord[]> {
|
||||
const res = await fetch(`/api/directus/db-objects/${objectId}/words`, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
const data = await res.json()
|
||||
if (!res.ok) throw new Error('Fehler beim Laden der Objekt-Wörter')
|
||||
return data.data as DbWord[]
|
||||
}
|
||||
|
||||
export async function updateDbPair(
|
||||
pairId: string,
|
||||
payload: { level?: number; question_de?: string; statement_de?: string },
|
||||
|
||||
Reference in New Issue
Block a user