Skip to content

Commit de0d7f2

Browse files
committed
fix: update blog structure
1 parent b7827f2 commit de0d7f2

File tree

6 files changed

+88
-0
lines changed

6 files changed

+88
-0
lines changed

src/api/blog-page/content-types/blog-page/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
"publishDate": {
4747
"type": "date",
4848
"required": true
49+
},
50+
"catogaries": {
51+
"type": "relation",
52+
"relation": "oneToMany",
53+
"target": "api::catogary.catogary",
54+
"mappedBy": "catogary"
4955
}
5056
}
5157
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "catogaries",
4+
"info": {
5+
"singularName": "catogary",
6+
"pluralName": "catogaries",
7+
"displayName": "Catogary"
8+
},
9+
"options": {
10+
"draftAndPublish": true
11+
},
12+
"pluginOptions": {},
13+
"attributes": {
14+
"category": {
15+
"type": "string"
16+
},
17+
"catogary": {
18+
"type": "relation",
19+
"relation": "manyToOne",
20+
"target": "api::blog-page.blog-page",
21+
"inversedBy": "catogaries"
22+
}
23+
}
24+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* catogary controller
3+
*/
4+
5+
import { factories } from '@strapi/strapi'
6+
7+
export default factories.createCoreController('api::catogary.catogary');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* catogary router
3+
*/
4+
5+
import { factories } from '@strapi/strapi';
6+
7+
export default factories.createCoreRouter('api::catogary.catogary');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* catogary service
3+
*/
4+
5+
import { factories } from '@strapi/strapi';
6+
7+
export default factories.createCoreService('api::catogary.catogary');

types/generated/contentTypes.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ export interface ApiBlogPageBlogPage extends Struct.CollectionTypeSchema {
421421
draftAndPublish: true;
422422
};
423423
attributes: {
424+
catogaries: Schema.Attribute.Relation<
425+
'oneToMany',
426+
'api::catogary.catogary'
427+
>;
424428
content: Schema.Attribute.RichText & Schema.Attribute.Required;
425429
createdAt: Schema.Attribute.DateTime;
426430
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
@@ -473,6 +477,38 @@ export interface ApiBlogBlog extends Struct.SingleTypeSchema {
473477
};
474478
}
475479

480+
export interface ApiCatogaryCatogary extends Struct.CollectionTypeSchema {
481+
collectionName: 'catogaries';
482+
info: {
483+
displayName: 'Catogary';
484+
pluralName: 'catogaries';
485+
singularName: 'catogary';
486+
};
487+
options: {
488+
draftAndPublish: true;
489+
};
490+
attributes: {
491+
category: Schema.Attribute.String;
492+
catogary: Schema.Attribute.Relation<
493+
'manyToOne',
494+
'api::blog-page.blog-page'
495+
>;
496+
createdAt: Schema.Attribute.DateTime;
497+
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
498+
Schema.Attribute.Private;
499+
locale: Schema.Attribute.String & Schema.Attribute.Private;
500+
localizations: Schema.Attribute.Relation<
501+
'oneToMany',
502+
'api::catogary.catogary'
503+
> &
504+
Schema.Attribute.Private;
505+
publishedAt: Schema.Attribute.DateTime;
506+
updatedAt: Schema.Attribute.DateTime;
507+
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
508+
Schema.Attribute.Private;
509+
};
510+
}
511+
476512
export interface ApiCommunitySupportCommunitySupport
477513
extends Struct.SingleTypeSchema {
478514
collectionName: 'community_supports';
@@ -1555,6 +1591,7 @@ declare module '@strapi/strapi' {
15551591
'api::about-us.about-us': ApiAboutUsAboutUs;
15561592
'api::blog-page.blog-page': ApiBlogPageBlogPage;
15571593
'api::blog.blog': ApiBlogBlog;
1594+
'api::catogary.catogary': ApiCatogaryCatogary;
15581595
'api::community-support.community-support': ApiCommunitySupportCommunitySupport;
15591596
'api::contact.contact': ApiContactContact;
15601597
'api::download.download': ApiDownloadDownload;

0 commit comments

Comments
 (0)