Files
brian-nelson-sveltekit/schemas/objects/feobj/scores.ts
2025-09-30 19:40:25 -04:00

29 lines
596 B
TypeScript

import { defineField, defineType } from 'sanity';
export const scores = defineType({
name: 'scores',
title: 'Scores',
type: 'object',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string'
}),
defineField({
name: 'score',
title: 'Score',
type: 'number',
validation: Rule => Rule.max(100)
})
],
options: {
columns: 2
},
preview: {
select: {
title: 'score',
subtitle: 'title'
}
}
})