box / box/box-ui-elements

Documentation Bug: sortBy option value for `modified_at` should actually be `date`

Open
#1,222 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.