From 51938fb276772f9e9980f19498e9bc30160e4587 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Mon, 30 Aug 2021 18:22:27 +0300 Subject: [PATCH] strapi menu model --- .../api/menu/config/routes.json | 28 +++++++++++++++++++ .../api/menu/controllers/menu.js | 8 ++++++ .../api/menu/models/menu.js | 8 ++++++ .../api/menu/models/menu.settings.json | 25 +++++++++++++++++ .../api/menu/services/menu.js | 8 ++++++ 5 files changed, 77 insertions(+) create mode 100644 modules/hudozka-strapi-api/api/menu/config/routes.json create mode 100644 modules/hudozka-strapi-api/api/menu/controllers/menu.js create mode 100644 modules/hudozka-strapi-api/api/menu/models/menu.js create mode 100644 modules/hudozka-strapi-api/api/menu/models/menu.settings.json create mode 100644 modules/hudozka-strapi-api/api/menu/services/menu.js diff --git a/modules/hudozka-strapi-api/api/menu/config/routes.json b/modules/hudozka-strapi-api/api/menu/config/routes.json new file mode 100644 index 00000000..febb1b67 --- /dev/null +++ b/modules/hudozka-strapi-api/api/menu/config/routes.json @@ -0,0 +1,28 @@ +{ + "routes": [ + { + "method": "GET", + "path": "/menu", + "handler": "menu.find", + "config": { + "policies": [] + } + }, + { + "method": "PUT", + "path": "/menu", + "handler": "menu.update", + "config": { + "policies": [] + } + }, + { + "method": "DELETE", + "path": "/menu", + "handler": "menu.delete", + "config": { + "policies": [] + } + } + ] +} diff --git a/modules/hudozka-strapi-api/api/menu/controllers/menu.js b/modules/hudozka-strapi-api/api/menu/controllers/menu.js new file mode 100644 index 00000000..556f4fce --- /dev/null +++ b/modules/hudozka-strapi-api/api/menu/controllers/menu.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) + * to customize this controller + */ + +module.exports = {}; diff --git a/modules/hudozka-strapi-api/api/menu/models/menu.js b/modules/hudozka-strapi-api/api/menu/models/menu.js new file mode 100644 index 00000000..dd847efd --- /dev/null +++ b/modules/hudozka-strapi-api/api/menu/models/menu.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) + * to customize this model + */ + +module.exports = {}; diff --git a/modules/hudozka-strapi-api/api/menu/models/menu.settings.json b/modules/hudozka-strapi-api/api/menu/models/menu.settings.json new file mode 100644 index 00000000..20723617 --- /dev/null +++ b/modules/hudozka-strapi-api/api/menu/models/menu.settings.json @@ -0,0 +1,25 @@ +{ + "kind": "singleType", + "collectionName": "menus", + "info": { + "name": "Menu", + "description": "" + }, + "options": { + "increments": true, + "timestamps": true, + "draftAndPublish": false + }, + "attributes": { + "menu": { + "type": "component", + "repeatable": false, + "component": "hudozka.card-grid", + "required": true + }, + "homeLabel": { + "type": "string", + "required": true + } + } +} diff --git a/modules/hudozka-strapi-api/api/menu/services/menu.js b/modules/hudozka-strapi-api/api/menu/services/menu.js new file mode 100644 index 00000000..6bc4168d --- /dev/null +++ b/modules/hudozka-strapi-api/api/menu/services/menu.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) + * to customize this service + */ + +module.exports = {};