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

Method processEntry

packages/decap-cms-core/src/backend.ts:1130–1147  ·  view source on GitHub ↗
(state: State, collection: Collection, entry: EntryValue)

Source from the content-addressed store, hash-verified

1128 }
1129
1130 async processEntry(state: State, collection: Collection, entry: EntryValue) {
1131 const integration = selectIntegration(state.integrations, null, 'assetStore');
1132 const mediaFolders = selectMediaFolders(
1133 state.config,
1134 collection,
1135 fromJS(entry) as unknown as EntryMap,
1136 );
1137 if (mediaFolders.length > 0 && !integration) {
1138 const files = await Promise.all(
1139 mediaFolders.map(folder => this.implementation.getMedia(folder)),
1140 );
1141 entry.mediaFiles = entry.mediaFiles.concat(...files);
1142 } else {
1143 entry.mediaFiles = entry.mediaFiles.concat(state.mediaLibrary.get('files') || []);
1144 }
1145
1146 return entry;
1147 }
1148
1149 async unpublishedEntry(state: State, collection: Collection, slug: string) {
1150 const entryData = await this.implementation!.unpublishedEntry!({

Callers 3

getEntryValueMethod · 0.95
unpublishedEntryMethod · 0.95
createEmptyDraftFunction · 0.80

Calls 6

selectIntegrationFunction · 0.90
selectMediaFoldersFunction · 0.90
fromJSFunction · 0.85
mapMethod · 0.80
getMethod · 0.80
getMediaMethod · 0.45

Tested by

no test coverage detected