From c57dd5e23f62816f8519e96ea7b0c368c6ba27a2 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 19 Jun 2023 19:08:55 +0100 Subject: [PATCH] feat: comment filter --- data/filter.json | 3 ++- src/components/common/Comment.tsx | 1 + src/models/page.model.ts | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/data/filter.json b/data/filter.json index 7b5fbc90..b4b5959d 100644 --- a/data/filter.json +++ b/data/filter.json @@ -1,3 +1,4 @@ { - "latest": [151, 53994, 54570, 54481, 54537, 54302, 53944, 55768, 55855, 56592, 54986] + "latest": [151, 53994, 54570, 54481, 54537, 54302, 53944, 55768, 55855, 56592, 54986], + "comment": [54986] } \ No newline at end of file diff --git a/src/components/common/Comment.tsx b/src/components/common/Comment.tsx index 94601a48..65aba941 100644 --- a/src/components/common/Comment.tsx +++ b/src/components/common/Comment.tsx @@ -1,5 +1,6 @@ "use client" +// TODO import { Virtuoso } from "react-virtuoso" import { CommentInput } from "~/components/common/CommentInput" diff --git a/src/models/page.model.ts b/src/models/page.model.ts index 5c5f208a..87190902 100644 --- a/src/models/page.model.ts +++ b/src/models/page.model.ts @@ -17,6 +17,8 @@ import { getKeys, getStorage } from "~/lib/storage" import { ExpandedNote, PageVisibilityEnum } from "~/lib/types" import { client } from "~/queries/graphql" +import filter from "../../data/filter.json" + export async function checkPageSlug(input: { slug: string characterId?: number @@ -609,6 +611,10 @@ export async function getComments({ list: [], } + res.list = res.list.filter( + (item) => !filter.comment.includes(item.characterId), + ) + return res }