structure for projects
This commit is contained in:
20
src/collections/Categories.ts
Normal file
20
src/collections/Categories.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { CollectionConfig } from 'payload';
|
||||
|
||||
import { slugField } from 'payload';
|
||||
|
||||
export const Categories: CollectionConfig = {
|
||||
slug: 'categories',
|
||||
admin: {
|
||||
useAsTitle: 'title',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
required: true,
|
||||
},
|
||||
slugField({
|
||||
position: undefined
|
||||
})
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
import { slugField } from 'payload'
|
||||
import { fa } from 'payload/i18n/fa'
|
||||
|
||||
export const Projects: CollectionConfig = {
|
||||
slug: 'projects',
|
||||
@@ -44,9 +45,32 @@ export const Projects: CollectionConfig = {
|
||||
type: 'text'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Settings',
|
||||
fields: [
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
slugField(),
|
||||
{
|
||||
name: 'featuredProject',
|
||||
type: 'checkbox',
|
||||
label: 'Make this a Featured Project',
|
||||
defaultValue: false,
|
||||
admin: {
|
||||
position: 'sidebar'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'order',
|
||||
type: 'number',
|
||||
defaultValue: 0,
|
||||
admin: {
|
||||
position: 'sidebar'
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -177,6 +177,8 @@ export interface Project {
|
||||
*/
|
||||
generateSlug?: boolean | null;
|
||||
slug: string;
|
||||
featuredProject?: boolean | null;
|
||||
order?: number | null;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
@@ -314,6 +316,8 @@ export interface ProjectsSelect<T extends boolean = true> {
|
||||
github?: T;
|
||||
generateSlug?: T;
|
||||
slug?: T;
|
||||
featuredProject?: T;
|
||||
order?: T;
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user