diff options
| author | Valentin Popov <valentin@popov.link> | 2026-02-05 13:19:56 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-02-05 13:19:56 +0300 |
| commit | efa89313fa4152252b477aafd88f7cf4a66747d8 (patch) | |
| tree | 5939b251fe1bbc6bea3881a71154cabd3aa538ec /playground/src/api/article | |
| parent | f6de8611955bf382612996500efba21a2d64ea1f (diff) | |
| download | strapi-plugin-checkbox-list-efa89313fa4152252b477aafd88f7cf4a66747d8.tar.xz strapi-plugin-checkbox-list-efa89313fa4152252b477aafd88f7cf4a66747d8.zip | |
Initial Strapi plugin project
Diffstat (limited to 'playground/src/api/article')
4 files changed, 70 insertions, 0 deletions
diff --git a/playground/src/api/article/content-types/article/schema.json b/playground/src/api/article/content-types/article/schema.json new file mode 100644 index 0000000..8df8823 --- /dev/null +++ b/playground/src/api/article/content-types/article/schema.json @@ -0,0 +1,49 @@ +{ + "kind": "collectionType", + "collectionName": "articles", + "info": { + "singularName": "article", + "pluralName": "articles", + "displayName": "Article", + "description": "Create your blog content" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "title": { + "type": "string" + }, + "description": { + "type": "text", + "maxLength": 80 + }, + "slug": { + "type": "uid", + "targetField": "title" + }, + "cover": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": ["images", "files", "videos"] + }, + "author": { + "type": "relation", + "relation": "manyToOne", + "target": "api::author.author", + "inversedBy": "articles" + }, + "category": { + "type": "relation", + "relation": "manyToOne", + "target": "api::category.category", + "inversedBy": "articles" + }, + "blocks": { + "type": "dynamiczone", + "components": ["shared.media", "shared.quote", "shared.rich-text", "shared.slider"] + } + } +} diff --git a/playground/src/api/article/controllers/article.ts b/playground/src/api/article/controllers/article.ts new file mode 100644 index 0000000..8b9d100 --- /dev/null +++ b/playground/src/api/article/controllers/article.ts @@ -0,0 +1,7 @@ +/** + * article controller + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreController('api::article.article'); diff --git a/playground/src/api/article/routes/article.ts b/playground/src/api/article/routes/article.ts new file mode 100644 index 0000000..a018052 --- /dev/null +++ b/playground/src/api/article/routes/article.ts @@ -0,0 +1,7 @@ +/** + * article router. + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::article.article'); diff --git a/playground/src/api/article/services/article.ts b/playground/src/api/article/services/article.ts new file mode 100644 index 0000000..4f14efa --- /dev/null +++ b/playground/src/api/article/services/article.ts @@ -0,0 +1,7 @@ +/** + * article service. + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::article.article'); |
