UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

20 lines 817 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.search = search; const transport_1 = require("../../../transport"); async function search(index) { const body = {}; const qs = {}; const requestMethod = 'POST'; const teamId = this.getNodeParameter('teamId', index); const returnAll = this.getNodeParameter('returnAll', 0); const endpoint = `teams/${teamId}/channels/search`; body.term = this.getNodeParameter('term', index); let responseData = await transport_1.apiRequest.call(this, requestMethod, endpoint, body, qs); if (!returnAll) { const limit = this.getNodeParameter('limit', 0); responseData = responseData.slice(0, limit); } return this.helpers.returnJsonArray(responseData); } //# sourceMappingURL=execute.js.map