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/category | |
| 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/category')
4 files changed, 52 insertions, 0 deletions
diff --git a/playground/src/api/category/content-types/category/schema.json b/playground/src/api/category/content-types/category/schema.json new file mode 100644 index 0000000..5121cdd --- /dev/null +++ b/playground/src/api/category/content-types/category/schema.json @@ -0,0 +1,31 @@ +{ + "kind": "collectionType", + "collectionName": "categories", + "info": { + "singularName": "category", + "pluralName": "categories", + "displayName": "Category", + "description": "Organize your content into categories" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "name": { + "type": "string" + }, + "slug": { + "type": "uid" + }, + "articles": { + "type": "relation", + "relation": "oneToMany", + "target": "api::article.article", + "mappedBy": "category" + }, + "description": { + "type": "text" + } + } +} diff --git a/playground/src/api/category/controllers/category.ts b/playground/src/api/category/controllers/category.ts new file mode 100644 index 0000000..dbfbd34 --- /dev/null +++ b/playground/src/api/category/controllers/category.ts @@ -0,0 +1,7 @@ +/** + * category controller + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreController('api::category.category'); diff --git a/playground/src/api/category/routes/category.ts b/playground/src/api/category/routes/category.ts new file mode 100644 index 0000000..4cbab60 --- /dev/null +++ b/playground/src/api/category/routes/category.ts @@ -0,0 +1,7 @@ +/** + * category router. + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::category.category'); diff --git a/playground/src/api/category/services/category.ts b/playground/src/api/category/services/category.ts new file mode 100644 index 0000000..c956dda --- /dev/null +++ b/playground/src/api/category/services/category.ts @@ -0,0 +1,7 @@ +/** + * category service. + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::category.category'); |
