feat(entry-states): display entity state for editors

This commit is contained in:
Benedikt Rötsch
2017-10-24 15:12:26 +02:00
parent 63ff3e0426
commit fd52efd625
8 changed files with 77 additions and 4 deletions

View File

@@ -26,11 +26,18 @@ exports.initClient = (options) => {
})
}
// Get the Space the app is connected to. Used for the settings form and to get all available locales.
exports.getSpace = assert((api = `cda`) => {
const client = api === 'cda' ? cdaClient : cpaClient
return client.getSpace()
}, 'Space')
// Get a single entry. Used to detect the `Draft` or `Pending Changes` state.
exports.getEntry = assert((entryId, api = `cda`) => {
const client = api === 'cda' ? cdaClient : cpaClient
return client.getEntry(entryId)
}, 'Entry')
// to get all the courses we request all the entries
// with the content_type `course` from Contentful
exports.getCourses = assert((locale = 'en-US', api = `cda`) => {