From b8eb008dd5927fb736e56699637f5f8549965eae Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 6 Dec 2023 18:20:54 +0100 Subject: refactor(hooks): replace useGithubApi with useGithubRepoMeta * use GraphQL API instead of REST (the inconvenient however is that we now need an authorization token...) * move fetcher in services * add tests * mock response using MSW --- src/types/data.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/types/data.ts') diff --git a/src/types/data.ts b/src/types/data.ts index 1d0746d..f58d6e7 100644 --- a/src/types/data.ts +++ b/src/types/data.ts @@ -254,7 +254,7 @@ export type Repos = { export type ProjectMeta = Omit & { contexts?: string[]; license?: string; - repos?: Repos; + repos: Repos; tagline?: string; technologies?: string[]; }; @@ -288,3 +288,9 @@ export type Topic = Page & { id: number; meta: TopicMeta; }; + +export type GithubRepositoryMeta = { + createdAt: string; + stargazerCount: number; + updatedAt: string; +}; -- cgit v1.2.3