Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
unpublishedEntry(collection, slug) {
const entry = window.repoFilesUnpublished.find(
e => e.metaData.collection === collection.get('name') && e.slug === slug,
);
if (!entry) {
return Promise.reject(
new EditorialWorkflowError('content is not under editorial workflow', true),
);
}
entry.mediaFiles = this.getMediaFiles(entry);
return Promise.resolve(entry);
}
}).catch(() => {
throw new EditorialWorkflowError('content is not under editorial workflow', true);
});
}
baseOwner,
baseRepoName,
baseExpression: `${this.branch}:${path}`,
},
});
if (!data.head.object) {
throw new EditorialWorkflowError('content is not under editorial workflow', true);
}
const result = {
metaData,
fileData: data.head.object.text,
isModification: !!data.base.object,
};
return result;
} else {
throw new EditorialWorkflowError('content is not under editorial workflow', true);
}
}
}).catch(() => {
throw new EditorialWorkflowError('content is not under editorial workflow', true);
});
}