Skip to content

Commit

Permalink
Merge pull request #531 from w3bdesign/develop
Browse files Browse the repository at this point in the history
♻️ refactor: enhance CV schema with preview configuration
  • Loading branch information
w3bdesign authored Dec 17, 2024
2 parents 5048fec + f426fc4 commit 9dd793f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions studio/schemaTypes/documents/cv.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
interface PreviewSelection {
keyQualifications?: string[]
}

export default {
name: 'cv',
title: 'CV',
type: 'document',
preview: {
select: {
keyQualifications: 'keyQualifications'
},
prepare(selection: PreviewSelection) {
const { keyQualifications } = selection
const mainQualification = keyQualifications?.[0] || 'No qualifications added'

return {
title: 'CV',
subtitle: mainQualification
}
}
},
fields: [
{
name: 'keyQualifications',
Expand Down

0 comments on commit 9dd793f

Please sign in to comment.