Create author component

This commit is contained in:
tobias
2024-05-21 11:17:40 +02:00
parent 09ad9bdc6d
commit 691729c53c
3 changed files with 45 additions and 8 deletions

View File

@ -3,12 +3,11 @@ import { isAdmin } from "@/access/isAdmin";
import { isEditor } from "@/access/isEditor";
import { isSSG } from "@/access/isSSG";
import { isUser } from "@/access/isUser";
import { isEditorOrSelf } from "@/access/isEditorOrSelf";
const Authors: CollectionConfig = {
slug: "authors",
admin: {
defaultColumns: ["avatar","name"],
defaultColumns: ["name"],
useAsTitle: "name",
},
access: {
@ -19,20 +18,26 @@ const Authors: CollectionConfig = {
delete: isEditor,
},
fields: [
{
name: "avatar",
type: "upload",
relationTo: "media",
required: true,
},
{
name: "name",
type: "text",
required: true
},
{
name: "avatar",
type: "upload",
relationTo: "media",
name: "bio",
type: "text",
required: false,
},
{
name: "user",
type: "relationship",
type: "upload",
relationTo: "users",
admin: {
description: 'The selected user will be able to edit this author'