Documentation Bug: sortBy option value for `modified_at` should actually be `date`
- Dominant language
- TypeScript
- Stars
- 551
- Forks
- 351
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 31
Description
Just ran into this on Box UI Elements v10.1.0. I was following the documentation for adding the default sort to be by Modified Date and was running into some trouble. It appears the suggestion in the documentation is incorrect?
https://developer.box.com/docs/box-content-explorer#section-options
> sortBy
>
> String
>
> name
>
> The initial sort by option for the content list. Value should be either `name` or `modified_at`.
Using `modified_at` like how the documentation says, results in a 400 Bad Request error, and from looking at the API request when sorting by date from the UI, it passes in `date` not `modified_at`. Using `sortBy='date'` instead works perfectly.
This also how the code does it in various places. For example for showing recents: https://github.com/box/box-ui-elements/blob/master/src/api/Recents.js#L82
Note: Now that https://github.com/box/box-ui-elements/pull/1239 was merged into master, there also should be a third value available for `size`. This should maybe be added to the documentation as well
Contributor guide
Assessment
This issue has not been assessed yet.