Merge branch 'react-pr' of https://github.com/netlify/netlify-cms into react-pr

This commit is contained in:
Cássio Zen
2016-09-05 12:13:51 -03:00
7 changed files with 450 additions and 11 deletions

View File

@ -1,5 +1,6 @@
import TestRepoBackend from './test-repo/implementation';
import GitHubBackend from './github/implementation';
import NetlifyGitBackend from './netlify-git/implementation';
import { resolveFormat } from '../formats/formats';
import { createEntry } from '../valueObjects/Entry';
import { SIMPLE, BRANCH } from './constants';
@ -48,6 +49,7 @@ class Backend {
entries(collection, page, perPage) {
return this.implementation.entries(collection, page, perPage).then((response) => {
console.log("Got %s entries", response.entries.length);
return {
pagination: response.pagination,
entries: response.entries.map(this.entryWithFormat(collection))
@ -159,6 +161,8 @@ export function resolveBackend(config) {
return new Backend(new TestRepoBackend(config), authStore);
case 'github':
return new Backend(new GitHubBackend(config), authStore);
case 'netlify-git':
return new Backend(new NetlifyGitBackend(config), authStore);
default:
throw `Backend not found: ${name}`;
}