From fab7c1eb0595f620348ea9bfb24e594b2b5c572b Mon Sep 17 00:00:00 2001 From: He4eT Date: Thu, 27 Mar 2025 09:51:14 +0100 Subject: [PATCH] State: init --- src/api/state/content-types/state/schema.json | 33 +++++++++++++++++++ src/api/state/controllers/state.ts | 7 ++++ src/api/state/routes/state.ts | 7 ++++ src/api/state/services/state.ts | 7 ++++ src/components/state/state-icon.json | 27 +++++++++++++++ 5 files changed, 81 insertions(+) create mode 100644 src/api/state/content-types/state/schema.json create mode 100644 src/api/state/controllers/state.ts create mode 100644 src/api/state/routes/state.ts create mode 100644 src/api/state/services/state.ts create mode 100644 src/components/state/state-icon.json diff --git a/src/api/state/content-types/state/schema.json b/src/api/state/content-types/state/schema.json new file mode 100644 index 0000000..cbf5383 --- /dev/null +++ b/src/api/state/content-types/state/schema.json @@ -0,0 +1,33 @@ +{ + "kind": "singleType", + "collectionName": "states", + "info": { + "singularName": "state", + "pluralName": "states", + "displayName": "State", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "attributes": { + "open": { + "type": "boolean", + "default": false + }, + "lastchange": { + "type": "biginteger" + }, + "trigger_person": { + "type": "string" + }, + "message": { + "type": "string" + }, + "icon": { + "type": "component", + "repeatable": false, + "component": "state.state-icon" + } + } +} diff --git a/src/api/state/controllers/state.ts b/src/api/state/controllers/state.ts new file mode 100644 index 0000000..d294bae --- /dev/null +++ b/src/api/state/controllers/state.ts @@ -0,0 +1,7 @@ +/** + * state controller + */ + +import { factories } from '@strapi/strapi' + +export default factories.createCoreController('api::state.state'); diff --git a/src/api/state/routes/state.ts b/src/api/state/routes/state.ts new file mode 100644 index 0000000..18fac95 --- /dev/null +++ b/src/api/state/routes/state.ts @@ -0,0 +1,7 @@ +/** + * state router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::state.state'); diff --git a/src/api/state/services/state.ts b/src/api/state/services/state.ts new file mode 100644 index 0000000..81353e8 --- /dev/null +++ b/src/api/state/services/state.ts @@ -0,0 +1,7 @@ +/** + * state service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::state.state'); diff --git a/src/components/state/state-icon.json b/src/components/state/state-icon.json new file mode 100644 index 0000000..9c6ca2c --- /dev/null +++ b/src/components/state/state-icon.json @@ -0,0 +1,27 @@ +{ + "collectionName": "components_state_state_icons", + "info": { + "displayName": "State Icons", + "icon": "lock", + "description": "" + }, + "options": {}, + "attributes": { + "open": { + "type": "media", + "multiple": false, + "required": true, + "allowedTypes": [ + "images" + ] + }, + "closed": { + "type": "media", + "multiple": false, + "required": true, + "allowedTypes": [ + "images" + ] + } + } +}