tomasg88 / bvlc

Bomberos voluntarios de Lujan de Cuyo
https://bomberoslujandecuyo.org.ar/
3 stars 0 forks source link

CMS: Agregar modelo Infraestructura #149

Open tomasg88 opened 5 months ago

tomasg88 commented 5 months ago

Descripción

Crear un nuevo tipo de documento en el schema con la siguiente estructura:

export default {
  name: 'infrastructure',
  type: 'document',
  title: 'Infraestructura',
  fields: [
    {
      name: 'name',
      type: 'string',
      title: 'Nombre del Área',
      validation: (Rule) => Rule.required(),
    },
    {
      name: 'description',
      type: 'string',
      title: 'text',
      validation: (Rule) => Rule.required(),
    },
    {
      name: 'imageList',
      title: 'Imágenes',
      type: 'array',
      description: 'Imágenes del área',
      of: [{ type: 'image' }],
      options: {
        hotspot: true,
      },
      validation: (Rule) => Rule.min(1).error('Debe añadir al menos una imágen al álbum'),
    },
  ]
}