fix(comment): refresh moderated report detail
This commit is contained in:
@@ -40,7 +40,8 @@ function ReportedCommentsPage() {
|
|||||||
|
|
||||||
const act = async (row: ReportedComment, action: ModerationAction, done: string) => {
|
const act = async (row: ReportedComment, action: ModerationAction, done: string) => {
|
||||||
try {
|
try {
|
||||||
await moderateReportedComment(row.id, action)
|
const response = await moderateReportedComment(row.id, action)
|
||||||
|
setDetail((current) => (current?.id === row.id ? response.data : current))
|
||||||
toast.success(done)
|
toast.success(done)
|
||||||
void list.query.refetch()
|
void list.query.refetch()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user