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

Method getStatuses

packages/decap-cms-backend-gitlab/src/API.ts:1015–1025  ·  view source on GitHub ↗
(collectionName: string, slug: string)

Source from the content-addressed store, hash-verified

1013 }
1014
1015 async getStatuses(collectionName: string, slug: string) {
1016 const contentKey = generateContentKey(collectionName, slug);
1017 const branch = branchFromContentKey(contentKey);
1018 const mergeRequest = await this.getBranchMergeRequest(branch);
1019 const statuses: GitLabCommitStatus[] = await this.getMergeRequestStatues(mergeRequest, branch);
1020 return statuses.map(({ name, status, target_url }) => ({
1021 context: name,
1022 state: status === GitLabCommitStatuses.Success ? PreviewState.Success : PreviewState.Other,
1023 target_url,
1024 }));
1025 }
1026
1027 async getUnpublishedEntrySha(collection: string, slug: string) {
1028 const contentKey = generateContentKey(collection, slug);

Callers 2

getDeployPreviewMethod · 0.45
API.spec.jsFile · 0.45

Calls 5

getBranchMergeRequestMethod · 0.95
generateContentKeyFunction · 0.90
branchFromContentKeyFunction · 0.90
mapMethod · 0.80

Tested by

no test coverage detected