@sanity/cli
Version:
Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets
40 lines (38 loc) • 684 B
JavaScript
import {defineField, defineType} from 'sanity'
export default defineType({
name: 'vendor',
title: 'Vendor',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
}),
defineField({
name: 'slug',
title: 'Slug',
type: 'slug',
options: {
source: 'title',
maxLength: 96,
},
}),
defineField({
name: 'logo',
title: 'logo',
type: 'image',
}),
defineField({
name: 'description',
title: 'Description',
type: 'blockContent',
}),
],
preview: {
select: {
title: 'title',
media: 'logo',
},
},
})