mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
33 lines
813 B
TypeScript
33 lines
813 B
TypeScript
import {defineField} from 'sanity'
|
|
|
|
export default defineField({
|
|
name: 'productOptions',
|
|
title: 'Product options',
|
|
type: 'object',
|
|
fields: [
|
|
defineField({
|
|
name: 'id',
|
|
title: 'ID (string)',
|
|
type: 'string',
|
|
validation: Rule => Rule.required(),
|
|
description: 'Unique product option ID.'
|
|
}),
|
|
defineField({
|
|
name: 'displayName',
|
|
title: 'Display name',
|
|
type: 'string',
|
|
description: 'Name displayed for this collection of product options.',
|
|
validation: Rule => Rule.required(),
|
|
}),
|
|
defineField({
|
|
name: 'values',
|
|
title: 'Values',
|
|
type: 'array',
|
|
description: 'What kind of values are available?',
|
|
of: [{type: 'productOption'}],
|
|
options: {},
|
|
validation: Rule => Rule.required(),
|
|
}),
|
|
],
|
|
})
|