fix: answer the author's conditional judgement

This commit is contained in:
shuai 2023-03-06 12:20:57 +08:00
parent 487b454165
commit 888e873a7c
1 changed files with 4 additions and 1 deletions

View File

@ -80,7 +80,10 @@ const Index = () => {
res.list = res.list?.filter((v) => {
// delete answers pnly show to author and admin and has searchparams aid
if (v.status === 10) {
if ((isAuthor || isAdmin) && aid === v.id) {
if (
(v?.user_info.username === userInfo?.username || isAdmin) &&
aid === v.id
) {
return v;
}
return null;