( wsId: string, id: string, author: string, text: string, )
| 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). */ |
| 481 | export 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 | } |
no test coverage detected