fix: distinguish comment/post/private message ids in reports view
This commit is contained in:
1 file changed
+4
-4
@@ -52,17 +52,17 @@ export async function load({ url, fetch }) {
|
|||||||
const grouped = everything.reduce(
|
const grouped = everything.reduce(
|
||||||
(groups, item) => {
|
(groups, item) => {
|
||||||
const key = isPostView(item.item)
|
const key = isPostView(item.item)
|
||||||
? item.item.post.id
|
? `post-${item.item.post.id}`
|
||||||
: isCommentView(item.item)
|
: isCommentView(item.item)
|
||||||
? item.item.comment.id
|
? `comment-${item.item.comment.id}`
|
||||||
: item.item.id
|
: `pm-${item.item.id}`
|
||||||
if (!groups[key]) {
|
if (!groups[key]) {
|
||||||
groups[key] = []
|
groups[key] = []
|
||||||
}
|
}
|
||||||
groups[key].push(item)
|
groups[key].push(item)
|
||||||
return groups
|
return groups
|
||||||
},
|
},
|
||||||
{} as Record<number, ReportView[]>,
|
{} as Record<string, ReportView[]>,
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in new issue
Block a user