Skip to content

Commit

Permalink
style: lint fix GitHubProvider.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
CMCDragonkai committed Oct 21, 2023
1 parent 19569a8 commit 5b01c9e
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/identities/providers/github/GitHubProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ class GitHubProvider extends Provider {
`${this.apiUrl}/graphql`,
{
method: 'POST',
body: this.getConnectedIdentityDatasGraphQLBody(authIdentityId, identityGroup, cursor)
body: this.getConnectedIdentityDatasGraphQLBody(
authIdentityId,
identityGroup,
cursor,
),
},
providerToken,
);
Expand Down Expand Up @@ -317,8 +321,8 @@ class GitHubProvider extends Provider {
throw new identitiesErrors.ErrorProviderCall(
`Provider response body contains an error: ${error.message}`,
{
data: error
}
data: error,
},
);
}
// FollowerConnection and FollowingConnection always exists on User
Expand All @@ -327,16 +331,20 @@ class GitHubProvider extends Provider {
const foundIdentityData: IdentityData[] = foundIdentityGroupData.nodes;
for (const identityData of foundIdentityData) {
identityData.providerId = this.id;
if (!foundIdentityIds.has(identityData.identityId) && identitiesUtils.matchIdentityData(identityData, searchTerms)) {
if (
!foundIdentityIds.has(identityData.identityId) &&
identitiesUtils.matchIdentityData(identityData, searchTerms)
) {
foundIdentityIds.add(identityData.identityId);
yield identityData;
}
}
if (foundIdentityData.length === 0) {
break;
} else {
// endCursor may be nullish if this is the last page
const endCursor: string | null = foundIdentityGroupData.pageInfo.endCursor;
// EndCursor may be nullish if this is the last page
const endCursor: string | null =
foundIdentityGroupData.pageInfo.endCursor;
if (endCursor == null) break;
cursor = endCursor;
}
Expand All @@ -362,11 +370,13 @@ class GitHubProvider extends Provider {
protected getConnectedIdentityDatasGraphQLBody(
authIdentityId: IdentityId,
identityGroup: 'following' | 'followers',
cursor?: string
cursor?: string,
): string {
const query = `query {
user(login: "${authIdentityId}") {
${identityGroup}(first: 100${cursor == null ? '' : `, after: "${cursor}"`}) {
${identityGroup}(first: 100${
cursor == null ? '' : `, after: "${cursor}"`
}) {
nodes {
identityId: login
name
Expand Down

0 comments on commit 5b01c9e

Please sign in to comment.