fix: allow setting per-file editor preview (#4414)

This commit is contained in:
stefanprobst
2020-10-12 12:33:18 +02:00
committed by GitHub
parent 083c20eaee
commit ecb4fd6165
2 changed files with 18 additions and 5 deletions

View File

@ -142,11 +142,11 @@ const getFieldsWithMediaFolders = (fields: EntryField[]) => {
return fieldsWithMediaFolders;
};
const getFileFromSlug = (collection: Collection, slug: string) => {
export const getFileFromSlug = (collection: Collection, slug: string) => {
return collection
.get('files')
?.toArray()
.filter(f => f.get('name') === slug)[0];
.find(f => f.get('name') === slug);
};
export const selectFieldsWithMediaFolders = (collection: Collection, slug: string) => {