Skip to content

Commit

Permalink
[cli] Use media for preview in movies template (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Mar 6, 2018
1 parent 2b77e3e commit a180273
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
select: {
subtitle: 'characterName',
title: 'person.name',
imageUrl: 'person.image.asset.url'
media: 'person.image'
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/cli/templates/moviedb/schemas/crewMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export default {
name: 'person.name',
job: 'job',
department: 'department',
imageUrl: 'person.image.asset.url'
media: 'person.image'
},
prepare(selection) {
const {name, job, department, imageUrl} = selection
const {name, job, department, media} = selection
return {
title: name,
subtitle: `${job} [${department}]`,
imageUrl: imageUrl
media
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/cli/templates/moviedb/schemas/movie.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default {
select: {
title: 'title',
date: 'releaseDate',
imageUrl: 'poster.asset.url',
media: 'poster',
castName0: 'castMembers.0.person.name',
castName1: 'castMembers.1.person.name'
},
Expand All @@ -77,7 +77,7 @@ export default {
title: `${selection.title} ${year ? `(${year})` : ''}`,
date: selection.date,
subtitle: cast,
imageUrl: selection.imageUrl
media: selection.media
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/templates/moviedb/schemas/person.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export default {
}
],
preview: {
select: {title: 'name', imageUrl: 'image.asset.url'}
select: {title: 'name', media: 'image'}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default {
preview: {
select: {
title: 'title',
imageUrl: 'movie.poster.asset.url'
media: 'movie.poster'
}
}
}

0 comments on commit a180273

Please sign in to comment.