function deleteComment
deleteComment(
commentId: string,
requestingUserId: string,
canModerate: boolean
): CommentDump

Deletes a comment, for DELETE /api/comments/:commentId. canModerate lets someone other than the author do it. The body is emptied and the backlinks dropped, but the row stays so its replies keep their place. The route broadcasts the deletion to those who may see the returned dump.

Parameters

commentId: string
requestingUserId: string
canModerate: boolean

Return Type

Throws

APIException

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

Usage

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