Allow the creation of new entries
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import TestRepoBackend from './test-repo/implementation';
|
||||
import GitHubBackend from './github/implementation';
|
||||
import { resolveFormat } from '../formats/formats';
|
||||
import { createEntry } from '../valueObjects/Entry';
|
||||
|
||||
class LocalStorageAuthStore {
|
||||
storageKey = 'nf-cms-user';
|
||||
@ -57,6 +58,11 @@ class Backend {
|
||||
return this.implementation.entry(collection, slug).then(this.entryWithFormat(collection));
|
||||
}
|
||||
|
||||
newEntry(collection) {
|
||||
const newEntry = createEntry();
|
||||
return this.entryWithFormat(collection)(newEntry);
|
||||
}
|
||||
|
||||
entryWithFormat(collection) {
|
||||
return (entry) => {
|
||||
const format = resolveFormat(collection, entry);
|
||||
|
Reference in New Issue
Block a user