Skip to content

Commit

Permalink
[structure] Make document list editor slightly more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 24, 2019
1 parent 6d5d4af commit 0bf527b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/@sanity/structure/src/DocumentList.ts
Expand Up @@ -24,9 +24,7 @@ const validateFilter = (spec: PartialDocumentList, options: SerializeOptions) =>

if (['*', '{'].includes(filter[0])) {
throw new SerializeError(
`\`filter\` cannot start with \`${
filter[0]
}\` - looks like you are providing a query, not a filter`,
`\`filter\` cannot start with \`${filter[0]}\` - looks like you are providing a query, not a filter`,
options.path,
spec.id,
spec.title
Expand All @@ -41,7 +39,8 @@ const resolveEditorChildForItem: ChildResolver = (
options: ChildResolverOptions
): ItemChild | Promise<ItemChild> | undefined => {
const parentItem = options.parent as DocumentList
return Promise.resolve(parentItem.schemaTypeName || resolveTypeForDocument(itemId)).then(type =>
const schemaType = parentItem.schemaTypeName || resolveTypeForDocument(itemId)
return Promise.resolve(schemaType).then(type =>
new EditorBuilder()
.id('editor')
.documentId(itemId)
Expand Down

0 comments on commit 0bf527b

Please sign in to comment.