Skip to content

Commit

Permalink
fix(push-to-space): sort entries before publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledgarbaya committed Jun 23, 2017
1 parent 8973250 commit e9c4392
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/push/push-to-space.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { defaults } from 'lodash/object'
import * as creation from './creation'
import * as publishing from './publishing'
import * as assets from './assets'

import sortEntries from '../get/sort-entries'
const DEFAULT_CONTENT_STRUCTURE = {
entries: [],
assets: [],
Expand Down Expand Up @@ -114,7 +114,9 @@ export default function ({
})
// Push Drafts
const draftsEntries = sourceContent.entries.filter(({original: entry}) => !entry.sys.publishedVersion)
const publishedEntries = sourceContent.entries.filter(({original: entry}) => entry.sys.publishedVersion)
const publishedEntries = sortEntries(
sourceContent.entries.filter(({original: entry}) => entry.sys.publishedVersion)
)

result = result
// create and push draftsEntries
Expand Down

0 comments on commit e9c4392

Please sign in to comment.