feat(blog): category and tag data structure
This commit is contained in:
parent
27f9c83e8e
commit
a16f9d0ca8
@ -17,12 +17,23 @@ export const BlogCategories: CollectionConfig = {
|
|||||||
position: "sidebar",
|
position: "sidebar",
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
beforeValidate: [formatSlug("title")],
|
beforeValidate: [formatSlug("name")],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "parent_category",
|
||||||
|
label: "Parent Category",
|
||||||
|
type: "relationship",
|
||||||
|
relationTo: "blogCategories",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "description",
|
||||||
|
type: "textarea",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
admin: {
|
admin: {
|
||||||
hideAPIURL: true,
|
hideAPIURL: true,
|
||||||
group: "Blogs",
|
group: "Blogs",
|
||||||
|
useAsTitle: "name",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -17,7 +17,7 @@ export const BlogTags: CollectionConfig = {
|
|||||||
position: "sidebar",
|
position: "sidebar",
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
beforeValidate: [formatSlug("title")],
|
beforeValidate: [formatSlug("name")],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -204,6 +204,8 @@ export interface BlogCategory {
|
|||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
slug?: string | null;
|
slug?: string | null;
|
||||||
|
parent_category?: (number | null) | BlogCategory;
|
||||||
|
description?: string | null;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
@ -725,6 +727,8 @@ export interface TeamsSelect<T extends boolean = true> {
|
|||||||
export interface BlogCategoriesSelect<T extends boolean = true> {
|
export interface BlogCategoriesSelect<T extends boolean = true> {
|
||||||
name?: T;
|
name?: T;
|
||||||
slug?: T;
|
slug?: T;
|
||||||
|
parent_category?: T;
|
||||||
|
description?: T;
|
||||||
updatedAt?: T;
|
updatedAt?: T;
|
||||||
createdAt?: T;
|
createdAt?: T;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user