fix: add comment and post restore
This commit is contained in:
1 parent
b1dc2173e9
commit
8f0f2b0919
3 files changed
+21
-3
No files matched your search
@@ -28,7 +28,9 @@ export type ActionName =
|
||||
| 'unban'
|
||||
| 'unbanCommunity'
|
||||
| 'postRemoval'
|
||||
| 'postRestore'
|
||||
| 'commentRemoval'
|
||||
| 'commentRestore'
|
||||
| 'postLock'
|
||||
| 'postUnlock'
|
||||
| 'postUnfeature'
|
||||
@@ -83,7 +85,9 @@ export const _toModLog = (item: ModAction): ModLog => {
|
||||
}
|
||||
} else if ('mod_remove_comment' in item) {
|
||||
return {
|
||||
actionName: 'commentRemoval',
|
||||
actionName: item.mod_remove_comment.removed
|
||||
? 'commentRemoval'
|
||||
: 'commentRestore',
|
||||
community: item.community,
|
||||
content: item.comment.content,
|
||||
timestamp: timestamp(item.mod_remove_comment.when_),
|
||||
@@ -94,7 +98,7 @@ export const _toModLog = (item: ModAction): ModLog => {
|
||||
}
|
||||
} else if ('mod_remove_post' in item) {
|
||||
return {
|
||||
actionName: 'postRemoval',
|
||||
actionName: item.mod_remove_post.removed ? 'postRemoval' : 'postRestore',
|
||||
community: item.community,
|
||||
content: item.post.name,
|
||||
timestamp: timestamp(item.mod_remove_post.when_),
|
||||
|
||||
@@ -58,6 +58,13 @@
|
||||
text: 'Removal',
|
||||
}
|
||||
}
|
||||
case 'commentRestore': {
|
||||
return {
|
||||
icon: Trash,
|
||||
class: 'text-green-600 dark:text-green-400',
|
||||
text: 'Restoration',
|
||||
}
|
||||
}
|
||||
case 'postRemoval': {
|
||||
return {
|
||||
icon: Trash,
|
||||
@@ -65,6 +72,13 @@
|
||||
text: 'Removal',
|
||||
}
|
||||
}
|
||||
case 'postRestore': {
|
||||
return {
|
||||
icon: Trash,
|
||||
class: 'text-green-600 dark:text-green-400',
|
||||
text: 'Restoration',
|
||||
}
|
||||
}
|
||||
case 'modAdd': {
|
||||
return {
|
||||
icon: UserPlus,
|
||||
|
||||
Reference in new issue
Block a user