structure for projects

This commit is contained in:
briannelson95
2025-10-11 09:40:12 -04:00
parent 4b7b26fbb2
commit edaad9a3fc
3 changed files with 48 additions and 0 deletions

View 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
})
]
}

View File

@@ -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'
}
},
],
}

View File

@@ -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;
}