function updateComment
updateComment(
commentId: string,
body: string,
requestingUserId: string,
canModerate: boolean
): { comment: Comment; dump: CommentDump; }

Replaces a comment's body, for PATCH /api/comments/:commentId. canModerate lets someone other than the author do it. It notifies, in the author's name, the users it mentions for the first time, unless the dump is private, and relinks the attachments and backlinks. The route broadcasts the comment to those who may see its dump.

Parameters

commentId: string
body: string
requestingUserId: string
canModerate: boolean

Return Type

{ comment: Comment; dump: CommentDump; }

Throws

APIException

404 when there is no such comment, 400 when it is deleted, 403 when the user is neither its author nor a moderator.

Usage

import { updateComment } from "api/services/comment-service.ts";