Skip to content

Commit

Permalink
[test-studio] Add a test case for selecting array items for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Jan 30, 2018
1 parent 75d7b61 commit f1ca669
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/test-studio/schemas/references.js
Expand Up @@ -35,9 +35,22 @@ export default {
name: 'weakAuthorRef',
title: 'A weak author ref',
weak: true,
to: {type: 'author'}
to: {type: 'author'},
}
]
},
],
preview: {
fields: {
title: 'title',
author0: 'array.0.name',
author1: 'array.1.name'
},
prepare(val) {
return {
title: val.title,
subtitle: [val.author0, val.author1].filter(Boolean).join(', ')
}
}
]
}
}

0 comments on commit f1ca669

Please sign in to comment.