From fd7f40cbdc02751b2548ef45d20cc53b144f744e Mon Sep 17 00:00:00 2001 From: Mehmet Date: Mon, 9 Dec 2024 15:16:33 +0100 Subject: [PATCH] feat: add terms entity type --- .changeset/old-ears-check.md | 5 +++ .../api/term/content-types/term/schema.json | 40 +++++++++++++++++++ apps/cms/src/api/term/controllers/term.ts | 7 ++++ apps/cms/src/api/term/routes/term.ts | 7 ++++ apps/cms/src/api/term/services/term.ts | 7 ++++ 5 files changed, 66 insertions(+) create mode 100644 .changeset/old-ears-check.md create mode 100644 apps/cms/src/api/term/content-types/term/schema.json create mode 100644 apps/cms/src/api/term/controllers/term.ts create mode 100644 apps/cms/src/api/term/routes/term.ts create mode 100644 apps/cms/src/api/term/services/term.ts diff --git a/.changeset/old-ears-check.md b/.changeset/old-ears-check.md new file mode 100644 index 00000000..ecf377e4 --- /dev/null +++ b/.changeset/old-ears-check.md @@ -0,0 +1,5 @@ +--- +"cms": minor +--- + +Added `terms` entity type diff --git a/apps/cms/src/api/term/content-types/term/schema.json b/apps/cms/src/api/term/content-types/term/schema.json new file mode 100644 index 00000000..cad3c692 --- /dev/null +++ b/apps/cms/src/api/term/content-types/term/schema.json @@ -0,0 +1,40 @@ +{ + "kind": "collectionType", + "collectionName": "terms", + "info": { + "singularName": "term", + "pluralName": "terms", + "displayName": "Termen" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "slug": { + "type": "string", + "required": true + }, + "rdf": { + "allowedTypes": [ + "files" + ], + "type": "media", + "multiple": false + }, + "ttl": { + "allowedTypes": [ + "files" + ], + "type": "media", + "multiple": false + }, + "json": { + "allowedTypes": [ + "files" + ], + "type": "media", + "multiple": false + } + } +} diff --git a/apps/cms/src/api/term/controllers/term.ts b/apps/cms/src/api/term/controllers/term.ts new file mode 100644 index 00000000..89862422 --- /dev/null +++ b/apps/cms/src/api/term/controllers/term.ts @@ -0,0 +1,7 @@ +/** + * term controller + */ + +import { factories } from '@strapi/strapi' + +export default factories.createCoreController('api::term.term'); diff --git a/apps/cms/src/api/term/routes/term.ts b/apps/cms/src/api/term/routes/term.ts new file mode 100644 index 00000000..a8411d8c --- /dev/null +++ b/apps/cms/src/api/term/routes/term.ts @@ -0,0 +1,7 @@ +/** + * term router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::term.term'); diff --git a/apps/cms/src/api/term/services/term.ts b/apps/cms/src/api/term/services/term.ts new file mode 100644 index 00000000..af98eb93 --- /dev/null +++ b/apps/cms/src/api/term/services/term.ts @@ -0,0 +1,7 @@ +/** + * term service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::term.term');