parent
195479f088
commit
bd1216c760
@ -182,7 +182,7 @@ export function loadEntry(entry, collection, slug) {
|
||||
const backend = currentBackend(state.config);
|
||||
dispatch(entryLoading(collection, slug));
|
||||
let getPromise;
|
||||
if (entry && entry.get('path')) {
|
||||
if (entry && entry.get('path') && entry.get('partial')) {
|
||||
getPromise = backend.getEntry(entry.get('collection'), entry.get('slug'), entry.get('path'));
|
||||
} else {
|
||||
getPromise = backend.lookupEntry(collection, slug);
|
||||
|
@ -48,7 +48,6 @@ export default class GitHub {
|
||||
});
|
||||
return Promise.all(promises);
|
||||
}).then(entries => ({
|
||||
pagination: 0,
|
||||
entries,
|
||||
}));
|
||||
}
|
||||
|
@ -28,20 +28,19 @@ export default class TestRepo {
|
||||
const entries = [];
|
||||
const folder = collection.get('folder');
|
||||
if (folder) {
|
||||
for (var path in window.repoFiles[folder]) {
|
||||
entries.push(createEntry(collection.get('name'), getSlug(path), folder + '/' + path, { raw: window.repoFiles[folder][path].content }));
|
||||
for (const path in window.repoFiles[folder]) {
|
||||
entries.push(createEntry(collection.get('name'), getSlug(path), `${ folder }/${ path }`, { raw: window.repoFiles[folder][path].content }));
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve({
|
||||
pagination: {},
|
||||
entries
|
||||
entries,
|
||||
});
|
||||
}
|
||||
|
||||
lookupEntry(collection, slug) {
|
||||
return this.entries(collection).then((response) => (
|
||||
response.entries.filter((entry) => entry.slug === slug)[0]
|
||||
return this.entries(collection).then(response => (
|
||||
response.entries.filter(entry => entry.slug === slug)[0]
|
||||
));
|
||||
}
|
||||
|
||||
@ -52,7 +51,7 @@ export default class TestRepo {
|
||||
if (newEntry) {
|
||||
window.repoFiles[folder][fileName] = { content: entry.raw };
|
||||
} else {
|
||||
window.repoFiles[folder][fileName]['content'] = entry.raw;
|
||||
window.repoFiles[folder][fileName].content = entry.raw;
|
||||
}
|
||||
mediaFiles.forEach(media => media.uploaded = true);
|
||||
return Promise.resolve();
|
||||
|
Loading…
x
Reference in New Issue
Block a user