How to use the netlify-cms-lib-util.EditorialWorkflowError function in netlify-cms-lib-util

To help you get started, we’ve selected a few netlify-cms-lib-util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netlify / netlify-cms / packages / netlify-cms-backend-test / src / implementation.js View on Github external
unpublishedEntry(collection, slug) {
    const entry = window.repoFilesUnpublished.find(
      e => e.metaData.collection === collection.get('name') && e.slug === slug,
    );
    if (!entry) {
      return Promise.reject(
        new EditorialWorkflowError('content is not under editorial workflow', true),
      );
    }
    entry.mediaFiles = this.getMediaFiles(entry);

    return Promise.resolve(entry);
  }
github netlify / netlify-cms / packages / netlify-cms-backend-github / src / API.js View on Github external
}).catch(() => {
      throw new EditorialWorkflowError('content is not under editorial workflow', true);
    });
  }
github netlify / netlify-cms / packages / netlify-cms-backend-github / src / GraphQLAPI.js View on Github external
baseOwner,
          baseRepoName,
          baseExpression: `${this.branch}:${path}`,
        },
      });
      if (!data.head.object) {
        throw new EditorialWorkflowError('content is not under editorial workflow', true);
      }
      const result = {
        metaData,
        fileData: data.head.object.text,
        isModification: !!data.base.object,
      };
      return result;
    } else {
      throw new EditorialWorkflowError('content is not under editorial workflow', true);
    }
  }
github netlify / netlify-cms / packages / netlify-cms-backend-github / src / API.ts View on Github external
}).catch(() => {
      throw new EditorialWorkflowError('content is not under editorial workflow', true);
    });
  }