fix: 질문 머리말이 관계에 담긴 프로젝트를 읽는다
질문 상세는 프로젝트를 `question` 이 아니라 `relations.primaryProject` 에 담는다 — Case/Reference 와 다른 자리다. `question` 에서 찾고 있었으므로 머리말의 프로젝트 칸이 늘 비어 있었다. 그 자리의 값은 `RelatedEntry` 라 `title`/`path` 를 쓴다. 머리말이 기다리는 것은 `name`/`slug` 이므로 옮겨 준다 — slug 는 경로의 마지막 마디다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189NzCryfeqDzS81EWidnBx
This commit is contained in:
co-authored by
Claude Opus 5
parent
ab4d822956
commit
ad8f322b43
@@ -142,6 +142,10 @@ export function createHttpPublicContentGateway(
|
||||
|
||||
const canonicalPath = String(detail.canonicalPath ?? "");
|
||||
const groups = (detail.relations as Readonly<Record<string, never>>) ?? {};
|
||||
const projectOf = (entry: Readonly<{ title?: string; path?: string }> | undefined) =>
|
||||
entry?.path
|
||||
? { name: entry.title ?? "", slug: entry.path.split("/").filter(Boolean).pop() ?? "", path: entry.path }
|
||||
: undefined;
|
||||
|
||||
if (kind === "CASE") {
|
||||
const body = (detail.case as Readonly<Record<string, unknown>>) ?? {};
|
||||
@@ -254,7 +258,15 @@ export function createHttpPublicContentGateway(
|
||||
summary: body.summary as string,
|
||||
path: canonicalPath,
|
||||
primaryTopic: body.primaryTopic as never,
|
||||
primaryProject: body.primaryProject as never,
|
||||
/*
|
||||
질문 상세는 프로젝트를 `question` 이 아니라 `relations.primaryProject` 에 담는다 —
|
||||
Case/Reference 와 다른 자리다. `question` 에서 찾고 있었으므로 머리말의 프로젝트
|
||||
칸이 늘 비어 있었다.
|
||||
|
||||
그 자리의 값은 `RelatedEntry` 라 `title`/`path` 를 쓴다. 머리말이 기다리는 것은
|
||||
`name`/`slug` 이므로 여기서 옮겨 준다 — slug 는 경로의 마지막 마디다.
|
||||
*/
|
||||
primaryProject: projectOf(groups.primaryProject) as never,
|
||||
publishedAt: body.updatedAt as string,
|
||||
/*
|
||||
계약이 주는 이름은 `resultCase` / `producedDecision` / `derivedReferences` 다.
|
||||
|
||||
@@ -84,6 +84,10 @@ test("a published Open Question maps its four point groups into the screen's fie
|
||||
assert.deepEqual([...record.unknowns], DETAIL.question.points.unknowns);
|
||||
assert.deepEqual([...record.constraints], DETAIL.question.points.constraints);
|
||||
assert.equal(record.nextValidation, DETAIL.question.nextVerification);
|
||||
// 질문 상세는 프로젝트를 `relations` 에 담는다 — `question` 에서 찾으면 머리말의 프로젝트
|
||||
// 칸이 늘 비어 있다.
|
||||
assert.equal(record.projectTitle, "KeyCloak Patterns");
|
||||
assert.equal(record.projectSlug, "keycloak-patterns");
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user