You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
761 B
TypeScript
43 lines
761 B
TypeScript
3 months ago
|
import type { CollectionConfig } from "payload";
|
||
|
import { Menu } from "../groups/Menu";
|
||
|
|
||
|
export const MenuItem: CollectionConfig = {
|
||
|
slug: "menu-item",
|
||
|
access: {
|
||
|
read: () => true,
|
||
|
},
|
||
|
admin: {
|
||
|
useAsTitle: "name",
|
||
|
group: Menu,
|
||
|
},
|
||
|
fields: [
|
||
|
{
|
||
|
name: "name",
|
||
|
type: "text",
|
||
|
required: true,
|
||
|
localized: true,
|
||
|
},
|
||
|
{
|
||
|
name: "description",
|
||
|
type: "richText",
|
||
|
localized: true,
|
||
|
},
|
||
|
{
|
||
|
name: "image",
|
||
|
type: "relationship",
|
||
|
relationTo: "media",
|
||
|
},
|
||
|
{
|
||
|
name: "category",
|
||
|
type: "relationship",
|
||
|
relationTo: "menu-category",
|
||
|
},
|
||
|
{
|
||
|
name: "tags",
|
||
|
type: "relationship",
|
||
|
relationTo: "menu-item-tag",
|
||
|
hasMany: true,
|
||
|
},
|
||
|
],
|
||
|
};
|