Skip to content

Commit

Permalink
add name extraction to getRepos
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMurray97 committed Dec 12, 2023
1 parent 64b87e0 commit 8ee8844
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/api-sdk/github/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { GitHubMembers, GitHubRepos, GitHubTeams, GitHubMembersPerTeam, GitHubRe

export const reposMapping = (body: any[]): GitHubRepos[] => {
return body.map((obj) => ({
name: obj.name,
description: obj.description,
full_name: obj.full_name,
visibility: obj.visibility,
Expand Down
1 change: 1 addition & 0 deletions src/api-sdk/github/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export interface GitHubRepos {
name: string;
description: string;
full_name: string;
visibility: string;
Expand Down
4 changes: 4 additions & 0 deletions test/mock/data.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const MOCK_HEADERS: ApiOptions = {

export const MOCK_REPOS = [
{
name: "repo1",
archived: false,
created_at: '2015-12-10T11:48:11Z',
description: 'Best repo 1',
Expand All @@ -17,6 +18,7 @@ export const MOCK_REPOS = [
visibility: 'public'
},
{
name: "repo2",
archived: false,
created_at: '2018-12-10T11:48:11Z',
description: 'Best repo 2',
Expand All @@ -29,6 +31,7 @@ export const MOCK_REPOS = [

export const MOCK_UNMAPPED_ENTREE_REPO = [
{
name: "repo1",
archived: false,
created_at: '2015-12-10T11:48:11Z',
description: 'Best repo 1',
Expand All @@ -39,6 +42,7 @@ export const MOCK_UNMAPPED_ENTREE_REPO = [
test: 'test'
},
{
name: "repo2",
archived: false,
created_at: '2018-12-10T11:48:11Z',
description: 'Best repo 2',
Expand Down

0 comments on commit 8ee8844

Please sign in to comment.