diff --git a/packages/nodes-base/nodes/Mattermost/v1/methods/loadOptions.ts b/packages/nodes-base/nodes/Mattermost/v1/methods/loadOptions.ts index e52d0f2aef..e0f24e2537 100644 --- a/packages/nodes-base/nodes/Mattermost/v1/methods/loadOptions.ts +++ b/packages/nodes-base/nodes/Mattermost/v1/methods/loadOptions.ts @@ -1,12 +1,12 @@ import type { IDataObject, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow'; -import { apiRequest } from '../transport'; +import { apiRequestAllItems } from '../transport'; // Get all the available channels export async function getChannels(this: ILoadOptionsFunctions): Promise { const endpoint = 'channels'; - const responseData = await apiRequest.call(this, 'GET', endpoint, {}); + const responseData = await apiRequestAllItems.call(this, 'GET', endpoint, {}); if (responseData === undefined) { throw new NodeOperationError(this.getNode(), 'No data got returned'); @@ -25,7 +25,7 @@ export async function getChannels(this: ILoadOptionsFunctions): Promise { const teamId = this.getCurrentNodeParameter('teamId'); const endpoint = `users/me/teams/${teamId}/channels`; - const responseData = await apiRequest.call(this, 'GET', endpoint, {}); + const responseData = await apiRequestAllItems.call(this, 'GET', endpoint, {}); if (responseData === undefined) { throw new NodeOperationError(this.getNode(), 'No data got returned'); @@ -72,7 +72,7 @@ export async function getChannelsInTeam( returnData.push({ name, - value: data.id, + value: data.id as string, }); } @@ -91,7 +91,7 @@ export async function getChannelsInTeam( export async function getTeams(this: ILoadOptionsFunctions): Promise { const endpoint = 'users/me/teams'; - const responseData = await apiRequest.call(this, 'GET', endpoint, {}); + const responseData = await apiRequestAllItems.call(this, 'GET', endpoint, {}); if (responseData === undefined) { throw new NodeOperationError(this.getNode(), 'No data got returned'); @@ -108,7 +108,7 @@ export async function getTeams(this: ILoadOptionsFunctions): Promise { const endpoint = 'users'; - const responseData = await apiRequest.call(this, 'GET', endpoint, {}); + const responseData = await apiRequestAllItems.call(this, 'GET', endpoint, {}); if (responseData === undefined) { throw new NodeOperationError(this.getNode(), 'No data got returned'); @@ -140,8 +140,8 @@ export async function getUsers(this: ILoadOptionsFunctions): Promise