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

Method deleteFiles

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

Source from the content-addressed store, hash-verified

567 }
568
569 async deleteFiles(paths: string[], comment: string) {
570 const ref = await this.getRef(this.branch);
571 const refUpdate = {
572 name: ref.name,
573 oldObjectId: ref.objectId,
574 };
575
576 const changes = paths.map(path =>
577 getChangeItem({ action: AzureCommitChangeType.DELETE, path }),
578 );
579 const commits = [{ comment, changes }];
580 const push = {
581 refUpdates: [refUpdate],
582 commits,
583 };
584
585 return this.requestJSON({
586 url: `${this.endpointUrl}/pushes`,
587 method: 'POST',
588 body: JSON.stringify(push),
589 });
590 }
591
592 async getPullRequests(sourceBranch?: string) {
593 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