23 lines
516 B
JavaScript
23 lines
516 B
JavaScript
const { createClient } = require('contentful')
|
|
|
|
const client = createClient({space: process.env.CF_SPACE, accessToken: process.env.CF_ACCESS_TOKEN})
|
|
|
|
export function getCourses () {
|
|
// to get all the courses we simply request from Contentful all the entries
|
|
// with the content_type `course`
|
|
return client.getEntries({content_type: 'course'})
|
|
}
|
|
|
|
export function getLessons (courseId) {
|
|
// TODO
|
|
}
|
|
|
|
export function getCategories () {
|
|
// TODO
|
|
}
|
|
|
|
export function getCoursesByCategory (category) {
|
|
// TODO
|
|
}
|
|
|