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

Method persistFiles

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

Source from the content-addressed store, hash-verified

554 }
555
556 async persistFiles(dataFiles: DataFile[], mediaFiles: AssetProxy[], options: PersistOptions) {
557 const files = [...dataFiles, ...mediaFiles];
558 const subfolders = options.hasSubfolders !== false; // default to true
559 if (options.useWorkflow) {
560 const slug = dataFiles[0].slug;
561 return this.editorialWorkflowGit(files, slug, options);
562 } else {
563 const items = await this.getCommitItems(files, this.branch, subfolders);
564
565 return this.uploadAndCommit(items, options.commitMessage, this.branch, true);
566 }
567 }
568
569 async deleteFiles(paths: string[], comment: string) {
570 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