diff --git a/lib/discussion.ts b/lib/discussion.ts index 29ab45c3..fdba95f4 100644 --- a/lib/discussion.ts +++ b/lib/discussion.ts @@ -55,16 +55,16 @@ export async function fetchGithubDiscussion( }); if (user) { - return await discussions.filter( + return discussions.filter( (discussion) => (discussion.participants ?? []).includes(user) || discussion.author === user, ); } else if (noOfDiscussion) { return discussions.slice(0, noOfDiscussion); + } else { + return discussions; } - - return discussions; } export async function checkAnsweredByUser(