Hello, today I'm using globals for the first time. As I understand it, and as the payload AI chatbot confirmed, globals are supposed to allow me to create a single record. For some reason, inside my admin panel I can create multiple. Here is my code
import { GlobalConfig } from 'payload/types'
import { TextLeft } from '../CustomComponents/ShopBlockImage1'
import Products from './Products'
import ShopMedia from './ShopMedia'
const Shop: GlobalConfig = {
slug: 'shop',
access: {
read: () => true,
// create: () => true,
update: () => true,
// delete: () => true,
},
fields: [
{
name: 'title',
type: 'text',
label: 'Titolo'
},
{
name: 'description',
type: 'textarea',
label: 'Descrizione'
},
{
type: 'upload',
relationTo: ShopMedia.slug,
name: 'shopHeaderImage',
label: 'Foto header'
},
{
type: 'ui',
name: 'shopBlock1',
admin: {
components: {
Field: TextLeft,
},
},
},
{
name: 'shopProducts',
type: 'relationship',
relationTo: Products.slug,
hasMany: true,
},
// Add a relationship to products, so when an admin wants to list and de-list products from the shop it is easier as it doesn't need to be deleted to remove it from the Shop page
],
}
export default Shop
Is it normal? Thanks!
Payload "version": "1.11.5"