Skip to content

Commit

Permalink
fix: update top contributors response data (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Jul 20, 2023
1 parent ac9b276 commit 9053091
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/hooks/useFetchTopContributors.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import useSWR, { Fetcher } from "swr";
import publicApiFetcher from "lib/utils/public-api-fetcher";

type TopContributorsResponse = { login: string }[];
type TopContributorsResponse = {
data: { login: string }[];
meta: Meta;
};

const useFetchTopContributors = () => {
const { data, error, mutate } = useSWR<TopContributorsResponse, Error>(
Expand All @@ -10,7 +13,7 @@ const useFetchTopContributors = () => {
);

return {
data: data ?? [],
data: data?.data ?? [],
isLoading: !error && !data,
isError: !!error,
mutate,
Expand Down

0 comments on commit 9053091

Please sign in to comment.