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

Method deleteFiles

packages/decap-cms-backend-azure/src/API.ts:575–596  ·  view source on GitHub ↗
(paths: string[], comment: string)

Source from the content-addressed store, hash-verified

573 }
574
575 async deleteFiles(paths: string[], comment: string) {
576 const ref = await this.getRef(this.branch);
577 const refUpdate = {
578 name: ref.name,
579 oldObjectId: ref.objectId,
580 };
581
582 const changes = paths.map(path =>
583 getChangeItem({ action: AzureCommitChangeType.DELETE, path }),
584 );
585 const commits = [{ comment, changes }];
586 const push = {
587 refUpdates: [refUpdate],
588 commits,
589 };
590
591 return this.requestJSON({
592 url: `${this.endpointUrl}/pushes`,
593 method: 'POST',
594 body: JSON.stringify(push),
595 });
596 }
597
598 async getPullRequests(sourceBranch?: string) {
599 const { value: pullRequests } = await this.requestJSON<AzureArray<AzurePullRequest>>({

Callers 2

deleteEntryMethod · 0.45
deleteMediaMethod · 0.45

Calls 3

getRefMethod · 0.95
getChangeItemFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected