deletion reason and email for soft deleted forum posts and comments by admin

This commit is contained in:
jackiettran
2025-11-20 18:08:30 -05:00
parent b2f18d77f6
commit f7767dfd13
10 changed files with 911 additions and 21 deletions

View File

@@ -286,9 +286,9 @@ export const forumAPI = {
deleteComment: (commentId: string) =>
api.delete(`/forum/comments/${commentId}`),
// Admin endpoints
adminDeletePost: (id: string) => api.delete(`/forum/admin/posts/${id}`),
adminDeletePost: (id: string, reason: string) => api.delete(`/forum/admin/posts/${id}`, { data: { reason } }),
adminRestorePost: (id: string) => api.patch(`/forum/admin/posts/${id}/restore`),
adminDeleteComment: (id: string) => api.delete(`/forum/admin/comments/${id}`),
adminDeleteComment: (id: string, reason: string) => api.delete(`/forum/admin/comments/${id}`, { data: { reason } }),
adminRestoreComment: (id: string) => api.patch(`/forum/admin/comments/${id}/restore`),
adminClosePost: (id: string) => api.patch(`/forum/admin/posts/${id}/close`),
adminReopenPost: (id: string) => api.patch(`/forum/admin/posts/${id}/reopen`),