Added documents.list endpoint to documentation (fixed some bad formatting)

Updated collection parameter
Increased fetch to 10 records, 5 looks dumb on larger screens
This commit is contained in:
Tom Moor
2017-11-22 18:40:37 -08:00
parent acdcb9e9ec
commit 7945abbe54
3 changed files with 37 additions and 27 deletions

View File

@ -15,12 +15,12 @@ const authDocumentForUser = (ctx, document) => {
const router = new Router();
router.post('documents.list', auth(), pagination(), async ctx => {
let { sort = 'updatedAt', direction, collectionId } = ctx.body;
let { sort = 'updatedAt', direction, collection } = ctx.body;
if (direction !== 'ASC') direction = 'DESC';
const user = ctx.state.user;
let where = { teamId: user.teamId };
if (collectionId) where = { ...where, atlasId: collectionId };
if (collection) where = { ...where, atlasId: collection };
const userId = user.id;
const starredScope = { method: ['withStarred', userId] };