fix: add comment and post restore

This commit is contained in:
Xyphyn committed 2023-08-24 17:06:25 -07:00
1 parent b1dc2173e9
commit 8f0f2b0919
3 files changed
+21 -3

No files matched your search

+6 -2
View File
@@ -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_),