Allow the creation of new entries

This commit is contained in:
Cássio Zen
2016-08-24 21:36:44 -03:00
parent fd79381160
commit b717874e7b
9 changed files with 73 additions and 29 deletions

View File

@ -1,5 +1,6 @@
import LocalForage from 'localforage';
import MediaProxy from '../../valueObjects/MediaProxy';
import { createEntry } from '../../valueObjects/Entry';
import AuthenticationPage from './AuthenticationPage';
import { Base64 } from 'js-base64';
@ -210,9 +211,7 @@ export default class GitHub {
return this.api.listFiles(collection.get('folder')).then((files) => (
Promise.all(files.map((file) => (
this.api.readFile(file.path, file.sha).then((data) => {
file.slug = file.path.split('/').pop().replace(/\.[^\.]+$/, '');
file.raw = data;
return file;
return createEntry(file.path, file.path.split('/').pop().replace(/\.[^\.]+$/, ''), data);
})
)))
)).then((entries) => ({