[GITHUB] Badge for total stars of an user / org (#5507)
* added badge for total stars of an user / org * Added a transformJson method in graphql-base to handle partial data Co-authored-by: Pratapi Hemant Patel <pratpatel@expedia.com> Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
This commit is contained in:
@@ -24,9 +24,9 @@ function errorMessagesFor(notFoundMessage = 'repo not found') {
|
||||
}
|
||||
}
|
||||
|
||||
function transformErrors(errors) {
|
||||
function transformErrors(errors, entity = 'repo') {
|
||||
if (errors[0].type === 'NOT_FOUND') {
|
||||
return new NotFound({ prettyMessage: 'repo not found' })
|
||||
return new NotFound({ prettyMessage: `${entity} not found` })
|
||||
} else {
|
||||
return new InvalidResponse({ prettyMessage: errors[0].message })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user