improvement(backends): changes for registerBackend compatibility (#1880)
This commit is contained in:
parent
751ec091fb
commit
da91038067
@ -6,7 +6,7 @@ import { currentBackend } from 'src/backend';
|
||||
import { getAsset } from 'Reducers';
|
||||
import { selectFields } from 'Reducers/collections';
|
||||
import { EDITORIAL_WORKFLOW } from 'Constants/publishModes';
|
||||
import { EditorialWorkflowError } from 'netlify-cms-lib-util';
|
||||
import { EDITORIAL_WORKFLOW_ERROR } from 'netlify-cms-lib-util';
|
||||
import { loadEntry } from './entries';
|
||||
import ValidationErrorTypes from 'Constants/validationErrorTypes';
|
||||
|
||||
@ -238,7 +238,7 @@ export function loadUnpublishedEntry(collection, slug) {
|
||||
.unpublishedEntry(collection, slug)
|
||||
.then(entry => dispatch(unpublishedEntryLoaded(collection, entry)))
|
||||
.catch(error => {
|
||||
if (error instanceof EditorialWorkflowError && error.notUnderEditorialWorkflow) {
|
||||
if (error.name === EDITORIAL_WORKFLOW_ERROR && error.notUnderEditorialWorkflow) {
|
||||
dispatch(unpublishedEntryRedirected(collection, slug));
|
||||
dispatch(loadEntry(collection, slug));
|
||||
} else {
|
||||
|
@ -449,7 +449,7 @@ class Backend {
|
||||
}
|
||||
|
||||
const commitMessage = commitMessageFormatter('delete', config, { collection, slug, path });
|
||||
return this.implementation.deleteFile(path, commitMessage);
|
||||
return this.implementation.deleteFile(path, commitMessage, { collection, slug });
|
||||
}
|
||||
|
||||
deleteMedia(config, path) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
export APIError from './APIError';
|
||||
export Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from './Cursor';
|
||||
export EditorialWorkflowError from './EditorialWorkflowError';
|
||||
export EditorialWorkflowError, { EDITORIAL_WORKFLOW_ERROR } from './EditorialWorkflowError';
|
||||
export localForage from './localForage';
|
||||
export { resolvePath, basename, fileExtensionWithSeparator, fileExtension } from './path';
|
||||
export { filterPromises, resolvePromiseProperties, then } from './promise';
|
||||
|
Loading…
x
Reference in New Issue
Block a user