How to use the netlify-cms-lib-util.unsentRequest.withParams 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-gitlab / src / API.js View on Github external
deleteFile = (path, commit_message, options = {}) => {
    const branch = options.branch || this.branch;
    const commitParams = { commit_message, branch };
    if (this.commitAuthor) {
      const { name, email } = this.commitAuthor;
      commitParams.author_name = name;
      commitParams.author_email = email;
    }
    return flow([
      unsentRequest.withMethod('DELETE'),
      // TODO: only send author params if they are defined.
      unsentRequest.withParams(commitParams),
      this.request,
    ])(`${this.repoURL}/repository/files/${encodeURIComponent(path)}`);
  };
}
github netlify / netlify-cms / packages / netlify-cms-backend-bitbucket / src / API.js View on Github external
listFiles = async (path, depth) => {
    const node = await this.branchCommitSha();
    const { entries, cursor } = await flow([
      // sort files by filename ascending
      unsentRequest.withParams({ sort: '-path', max_depth: depth }),
      this.requestJSON,
      then(this.getEntriesAndCursor),
    ])(`${this.repoURL}/src/${node}/${path}`);
    return { entries: this.processFiles(entries), cursor };
  };