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 type { CollectionConfig } from 'payload'
|
||||||
import { slugField } from 'payload'
|
import { slugField } from 'payload'
|
||||||
|
import { fa } from 'payload/i18n/fa'
|
||||||
|
|
||||||
export const Projects: CollectionConfig = {
|
export const Projects: CollectionConfig = {
|
||||||
slug: 'projects',
|
slug: 'projects',
|
||||||
@@ -44,9 +45,32 @@ export const Projects: CollectionConfig = {
|
|||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Settings',
|
||||||
|
fields: [
|
||||||
|
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
slugField(),
|
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;
|
generateSlug?: boolean | null;
|
||||||
slug: string;
|
slug: string;
|
||||||
|
featuredProject?: boolean | null;
|
||||||
|
order?: number | null;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
@@ -314,6 +316,8 @@ export interface ProjectsSelect<T extends boolean = true> {
|
|||||||
github?: T;
|
github?: T;
|
||||||
generateSlug?: T;
|
generateSlug?: T;
|
||||||
slug?: T;
|
slug?: T;
|
||||||
|
featuredProject?: T;
|
||||||
|
order?: T;
|
||||||
updatedAt?: T;
|
updatedAt?: T;
|
||||||
createdAt?: T;
|
createdAt?: T;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user