import { CollectionConfig } from "payload"; export const Books: CollectionConfig = { slug: "books", admin: { useAsTitle: 'title' }, access: { read: () => true, update: () => true, create: () => true, admin: () => true, }, fields: [ { name: "books_id", // This is from the import type: "text", unique: true, admin: { placeholder: "This is only for books that have been imported.", } }, { name: "title", type: "text", }, { name: "authors", type: "relationship", relationTo: "authors", hasMany: true, maxDepth: 3, }, { name: 'pages', type: 'number', }, { name: 'lcc', type: 'text', }, { name: 'isbn', type: 'text', }, { name: 'asin', type: 'text', }, { name: 'publication', type: 'text', }, { label: 'Publication Date', name: 'date', type: 'text', }, { name: 'genre', type: 'relationship', relationTo: 'genre', hasMany: true, maxDepth: 3, admin: { allowEdit: true, allowCreate: true } }, { type: 'textarea', name: 'summary', }, { name: 'description', type: 'richText' }, { name: 'copies', type: 'join', collection: 'copies', on: 'book', } ], }