trello-node-api icon indicating copy to clipboard operation
trello-node-api copied to clipboard

Board search labels endpoint has changed

Open itdsntwork opened this issue 4 years ago • 1 comments

board.searchLabels method I think calls an incorrect endpoint

searchLabels: trelloMethod({ method: 'GET', path: '/{id}/customLabels', urlParams: [ 'id' ] }),

path should be '/{id}/labels' base on API documentation https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-labels-get

itdsntwork avatar Dec 16 '20 17:12 itdsntwork

For anyone coming here, while the merge request is not merged, you can do this "ugly solution"

const Trello = require('trello-node-api');
const trelloMethod = require('trello-node-api/lib/TrelloMethod');

const trello = new Trello('abc', 'def');
  
// This overrides the trello library as the searchLabels is outdated.
trello.board.searchLabels = trelloMethod({
  method: 'GET',
  path: '/{id}/labels',
  urlParams: ['id'],
});

ajimix avatar Jan 23 '21 16:01 ajimix