MCPcopy Create free account
hub / github.com/decaporg/decap-cms / persistFiles

Method persistFiles

packages/decap-cms-backend-azure/src/API.ts:562–573  ·  view source on GitHub ↗
(dataFiles: DataFile[], mediaFiles: AssetProxy[], options: PersistOptions)

Source from the content-addressed store, hash-verified

560 }
561
562 async persistFiles(dataFiles: DataFile[], mediaFiles: AssetProxy[], options: PersistOptions) {
563 const files = [...dataFiles, ...mediaFiles];
564 const subfolders = options.hasSubfolders !== false; // default to true
565 if (options.useWorkflow) {
566 const slug = dataFiles[0].slug;
567 return this.editorialWorkflowGit(files, slug, options);
568 } else {
569 const items = await this.getCommitItems(files, this.branch, subfolders);
570
571 return this.uploadAndCommit(items, options.commitMessage, this.branch, true);
572 }
573 }
574
575 async deleteFiles(paths: string[], comment: string) {
576 const ref = await this.getRef(this.branch);

Callers 2

persistEntryMethod · 0.45
persistMediaMethod · 0.45

Calls 3

editorialWorkflowGitMethod · 0.95
getCommitItemsMethod · 0.95
uploadAndCommitMethod · 0.95

Tested by

no test coverage detected