Skip to content

Commit

Permalink
fix(get-full-source-space): Sort Exported entries
Browse files Browse the repository at this point in the history
reorders them so that entries which are linked from other entries always
come first in the order. This ensures that when we publish entries, we
are not publishing entries which contain links to other entries which haven't been published yet.
  • Loading branch information
Khaledgarbaya committed Jun 23, 2017
1 parent 4d5e748 commit 8973250
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/get/get-full-source-space.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Promise from 'bluebird'
import Listr from 'listr'
import verboseRenderer from 'listr-verbose-renderer'
import sortEntries from './sort-entries'

const MAX_ALLOWED_LIMIT = 1000
let pageLimit = MAX_ALLOWED_LIMIT
Expand Down Expand Up @@ -73,6 +74,7 @@ Full error details below.
task: (ctx) => {
return pagedGet(ctx.space, 'getEntries')
.then(extractItems)
.then(sortEntries)
.then((items) => filterDrafts(items, includeDrafts))
.then((items) => {
ctx.data.entries = items
Expand Down

0 comments on commit 8973250

Please sign in to comment.