Add json format support
This commit is contained in:
@ -87,13 +87,8 @@ class Backend {
|
||||
|
||||
// We have the file path. Fetch and parse the file.
|
||||
getEntry(collection, slug, path) {
|
||||
return this.implementation.getEntry(collection, slug, path).then(this.entryWithFormat(collection));
|
||||
}
|
||||
|
||||
lookupEntry(collection, slug) {
|
||||
const collectionModel = new Collection(collection);
|
||||
return this.implementation.getEntry(collection, slug, collectionModel.entryPath(slug))
|
||||
.then(loadedEntry => this.entryWithFormat(collection)(createEntry(
|
||||
return this.implementation.getEntry(collection, slug, path)
|
||||
.then(loadedEntry => this.entryWithFormat(collection, slug)(createEntry(
|
||||
collection.get('name'),
|
||||
slug,
|
||||
loadedEntry.file.path,
|
||||
@ -102,6 +97,10 @@ class Backend {
|
||||
);
|
||||
}
|
||||
|
||||
lookupEntry(collection, slug) {
|
||||
return this.getEntry(collection, slug, new Collection(collection).entryPath(slug));
|
||||
}
|
||||
|
||||
newEntry(collection) {
|
||||
return createEntry(collection.get('name'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user