Skip to content

Commit

Permalink
fix type error in api.ts mismatch in return type of discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
dgparmar14 committed Jul 19, 2024
1 parent 1ac9b0a commit 02508f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/discussion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -123,7 +124,7 @@ export async function getGithubDiscussions(githubHandle: string) {
link: discussion.link,
text: "",
discussion: discussion,
};
} as Activity;
}),
);

Expand Down

0 comments on commit 02508f8

Please sign in to comment.