mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +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: {
|
||||
searchListMethod: 'getUsers',
|
||||
searchable: true,
|
||||
searchFilterRequired: true,
|
||||
searchFilterRequired: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1705,7 +1705,9 @@ export class Github implements INodeType {
|
||||
maxValue: 100,
|
||||
},
|
||||
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',
|
||||
|
||||
@@ -37,13 +37,23 @@ export async function getUsers(
|
||||
): Promise<INodeListSearchResult> {
|
||||
const page = paginationToken ? +paginationToken : 1;
|
||||
const per_page = 100;
|
||||
const responseData: UserSearchResponse = await githubApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
'/search/users',
|
||||
{},
|
||||
{ q: filter, page, per_page },
|
||||
);
|
||||
|
||||
let responseData: UserSearchResponse = {
|
||||
items: [],
|
||||
total_count: 0,
|
||||
};
|
||||
|
||||
try {
|
||||
responseData = await githubApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
'/search/users',
|
||||
{},
|
||||
{ q: filter, page, per_page },
|
||||
);
|
||||
} catch {
|
||||
// will fail if the owner does not have any users
|
||||
}
|
||||
|
||||
const results: INodeListSearchItems[] = responseData.items.map((item: UserSearchItem) => ({
|
||||
name: item.login,
|
||||
|
||||
Reference in New Issue
Block a user