feat(geschichten): wire discovery integrations on Person and Document pages
Person detail (/persons/[id]):
- Server load fetches GET /api/geschichten?status=PUBLISHED&personId={id}
in parallel with the existing person/document queries.
- Renders <GeschichtenCard> below the received-documents list when the
person has at least one published story.
Document detail (/documents/[id]):
- Server load adds the same parallel call with documentId={id}.
- DocumentTopBar gains geschichten + canBlogWrite props that flow through
to DocumentMetadataDrawer.
- DocumentMetadataDrawer's grid expands to lg:grid-cols-4 when the
Geschichten column should appear (stories exist OR user can author),
and shows "+ Geschichte anhängen" / "Alle anzeigen" links following the
>= 3-story threshold from issue comment #5758.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -17,14 +17,18 @@ export async function load({ params, fetch, locals }) {
|
||||
receivedDocsResult,
|
||||
aliasesResult,
|
||||
relsResult,
|
||||
inferredResult
|
||||
inferredResult,
|
||||
geschichtenResult
|
||||
] = await Promise.all([
|
||||
api.GET('/api/persons/{id}', { params: { path: { id } } }),
|
||||
api.GET('/api/persons/{id}/documents', { params: { path: { id } } }),
|
||||
api.GET('/api/persons/{id}/received-documents', { params: { path: { id } } }),
|
||||
api.GET('/api/persons/{id}/aliases', { params: { path: { id } } }),
|
||||
api.GET('/api/persons/{id}/relationships', { params: { path: { id } } }),
|
||||
api.GET('/api/persons/{id}/inferred-relationships', { params: { path: { id } } })
|
||||
api.GET('/api/persons/{id}/inferred-relationships', { params: { path: { id } } }),
|
||||
api.GET('/api/geschichten', {
|
||||
params: { query: { status: 'PUBLISHED', personId: id } }
|
||||
})
|
||||
]);
|
||||
|
||||
if (!personResult.response.ok) {
|
||||
@@ -39,6 +43,7 @@ export async function load({ params, fetch, locals }) {
|
||||
aliases: aliasesResult.data ?? [],
|
||||
relationships: relsResult.data ?? [],
|
||||
inferredRelationships: inferredResult.data ?? [],
|
||||
geschichten: geschichtenResult.data ?? [],
|
||||
canWrite
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user