1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-09 15:35:25 +02:00

reverse children sorting

This commit is contained in:
Peter Savchenko 2018-10-19 21:02:19 +03:00
parent 23abb4584c
commit a6e5308565
No known key found for this signature in database
GPG key ID: 63E739583C761566

View file

@ -9,7 +9,7 @@ const asyncMiddleware = require('../../utils/asyncMiddleware');
function createMenuTree(pages) {
return pages.filter(page => page._parent === '0').map(page => {
return Object.assign({
children: pages.filter(child => child._parent === page._id)
children: pages.filter(child => child._parent === page._id).reverse()
}, page.data);
});
}