From 02508f89b98329b0b4c92c8c8b6cad2a8aab2dd8 Mon Sep 17 00:00:00 2001 From: dhrumit parmar Date: Fri, 19 Jul 2024 11:50:26 +0530 Subject: [PATCH] fix type error in api.ts mismatch in return type of discussion --- lib/discussion.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/discussion.ts b/lib/discussion.ts index 8f2f4519..b5fd0e6e 100644 --- a/lib/discussion.ts +++ b/lib/discussion.ts @@ -5,6 +5,7 @@ import path, { join } from "path"; import stripJsonComments from "strip-json-comments"; import octokit from "./octokit"; import { featureIsEnabled } from "./utils"; +import { Activity } from "./types"; const cwd = process.cwd(); @@ -95,7 +96,7 @@ export async function checkAnsweredByUser( export async function getGithubDiscussions(githubHandle: string) { const response = await fetchGithubDiscussion(null, githubHandle); - if (response === null) return []; + if (response === null) return [] as Activity[]; const discussions = await Promise.all( response.map(async (discussion: ParsedDiscussion) => { const isAuthor = discussion.author === githubHandle; @@ -123,7 +124,7 @@ export async function getGithubDiscussions(githubHandle: string) { link: discussion.link, text: "", discussion: discussion, - }; + } as Activity; }), );