Saltar al contenido principal

Function: deletePost()

function deletePost(
context,
siteUrl,
postId
): Promise<{
changed: string;
discussionDeleted: boolean;
discussionId?: number;
replies: number;
}>;

Defined in: areas/forums/posts.ts:345

Deletes a post and its replies through Moodle's own confirmation (post.php?delete=); a discussion's first post takes the whole discussion. Only a moderator deletes a post with replies, or someone else's. replies says how many replies went with it. Throws ForumError with Moodle's reason when it refuses.

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
postIdnumber

Returns​

Promise<{ changed: string; discussionDeleted: boolean; discussionId?: number; replies: number; }>