box-node-sdk
box-node-sdk copied to clipboard
array for fields option when using getItems
client.folders.getItems(id,{ offset: offset, limit: limit, fields: ['name','modified_at'], sort: 'date', direction: 'DESC' })
when I add fields to an array as above, only the first item in the array is returned in the response. any other fields in the array are ignored.
The docs don't really help because all the examples show adding just one field.
What am I missing?
Answering my own question: it doesn't take an array, just a comma separated string of fields names. Not intuitive IMHO. Plus the code should throw a meaningful error if you feed it an array when it is not expecting one.
This works:
client.folders.getItems(id,{ offset: offset, limit: limit, fields: 'name,modified_at', sort: 'date', direction: 'DESC' })
This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.
This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Node SDK and feel free to open another PR/issue at any time.