mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(GitHub Node): Fix issue with user loading not completing (#17122)
This commit is contained in:
@@ -507,7 +507,7 @@ export class Github implements INodeType {
|
|||||||
typeOptions: {
|
typeOptions: {
|
||||||
searchListMethod: 'getUsers',
|
searchListMethod: 'getUsers',
|
||||||
searchable: true,
|
searchable: true,
|
||||||
searchFilterRequired: true,
|
searchFilterRequired: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1705,7 +1705,9 @@ export class Github implements INodeType {
|
|||||||
maxValue: 100,
|
maxValue: 100,
|
||||||
},
|
},
|
||||||
default: 50,
|
default: 50,
|
||||||
description: 'Max number of results to return',
|
// eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-limit
|
||||||
|
description:
|
||||||
|
'Max number of results to return. Maximum value is <a href="https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests">100</a>.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Filters',
|
displayName: 'Filters',
|
||||||
|
|||||||
@@ -37,13 +37,23 @@ export async function getUsers(
|
|||||||
): Promise<INodeListSearchResult> {
|
): Promise<INodeListSearchResult> {
|
||||||
const page = paginationToken ? +paginationToken : 1;
|
const page = paginationToken ? +paginationToken : 1;
|
||||||
const per_page = 100;
|
const per_page = 100;
|
||||||
const responseData: UserSearchResponse = await githubApiRequest.call(
|
|
||||||
|
let responseData: UserSearchResponse = {
|
||||||
|
items: [],
|
||||||
|
total_count: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
responseData = await githubApiRequest.call(
|
||||||
this,
|
this,
|
||||||
'GET',
|
'GET',
|
||||||
'/search/users',
|
'/search/users',
|
||||||
{},
|
{},
|
||||||
{ q: filter, page, per_page },
|
{ q: filter, page, per_page },
|
||||||
);
|
);
|
||||||
|
} catch {
|
||||||
|
// will fail if the owner does not have any users
|
||||||
|
}
|
||||||
|
|
||||||
const results: INodeListSearchItems[] = responseData.items.map((item: UserSearchItem) => ({
|
const results: INodeListSearchItems[] = responseData.items.map((item: UserSearchItem) => ({
|
||||||
name: item.login,
|
name: item.login,
|
||||||
|
|||||||
Reference in New Issue
Block a user