feat: object label per object + {obj:UUID} sentence placeholders
- Annotate: per-object single label input (M2M via db_objects_db_words), auto-save on blur, remove picture-level word section
- Generate: object chips insert {obj:UUID} at cursor position in question/statement textarea
- Live preview resolves {obj:UUID} → actual object label
- PairsList display also resolves placeholders
- Remove F/A/B word chip system from pair form (replaced by object placeholders)
- Backend: POST /api/directus/db-objects/<id>/words replaces existing word with single label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -463,6 +463,19 @@ export async function getDbObjectWords(objectId: string, token: string): Promise
|
||||
return data.data as DbWord[]
|
||||
}
|
||||
|
||||
export async function saveDbObjectWord(
|
||||
objectId: string,
|
||||
word: { titel_de: string; level: number } | null,
|
||||
token: string
|
||||
) {
|
||||
const res = await fetch(`/api/directus/db-objects/${objectId}/words`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Authorization: token },
|
||||
body: JSON.stringify(word ? { titel_de: word.titel_de, level: word.level } : { titel_de: '' }),
|
||||
})
|
||||
return res.json()
|
||||
}
|
||||
|
||||
export async function updateDbPair(
|
||||
pairId: string,
|
||||
payload: {
|
||||
|
||||
Reference in New Issue
Block a user