Skip to content

Commit 38f5ffd

Browse files
authored
Simplify repository existence checks for user and org
1 parent 9296151 commit 38f5ffd

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/fetchers/repo.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const fetchRepo = async (username, reponame) => {
8989
const isOrg = data.user === null && data.organization;
9090

9191
if (isUser) {
92-
if (!data.user.repository || data.user.repository.isPrivate) {
92+
if (!data.user.repository) {
9393
throw new Error("User Repository Not found");
9494
}
9595
return {
@@ -99,10 +99,7 @@ const fetchRepo = async (username, reponame) => {
9999
}
100100

101101
if (isOrg) {
102-
if (
103-
!data.organization.repository ||
104-
data.organization.repository.isPrivate
105-
) {
102+
if (!data.organization.repository) {
106103
throw new Error("Organization Repository Not found");
107104
}
108105
return {

0 commit comments

Comments
 (0)