MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / demoIssueAddComment

Function demoIssueAddComment

ui/src/demo/fixtures/issues.ts:481–496  ·  view source on GitHub ↗
(
  wsId: string,
  id: string,
  author: string,
  text: string,
)

Source from the content-addressed store, hash-verified

479 * an extras entry for rows that only had the generic fallback body), then return
480 * the fresh detail shape. Returns null when the issue doesn't exist (→ 404). */
481export function demoIssueAddComment(
482 wsId: string,
483 id: string,
484 author: string,
485 text: string,
486): IssueDetail | null {
487 const boardIssue = findBoardIssue(wsId, id)
488 if (!boardIssue) return null
489 const key = `${wsId}/${id}`
490 const existing = demoIssueExtras[key]
491 const currentBody = existing?.body ?? `${boardIssue.title}\n\n(No description.)`
492 const nextBody = appendCommentToBody(currentBody, author, text)
493 if (existing) existing.body = nextBody
494 else demoIssueExtras[key] = { body: nextBody, runs: [] }
495 return demoIssueDetail(wsId, id)
496}

Callers 1

issues.tsFile · 0.90

Calls 3

findBoardIssueFunction · 0.85
appendCommentToBodyFunction · 0.85
demoIssueDetailFunction · 0.85

Tested by

no test coverage detected