diff --git a/src/api/rein-costume/content-types/rein-costume/schema.json b/src/api/rein-costume/content-types/rein-costume/schema.json index f105221..9bad0ce 100644 --- a/src/api/rein-costume/content-types/rein-costume/schema.json +++ b/src/api/rein-costume/content-types/rein-costume/schema.json @@ -19,7 +19,7 @@ }, "thumbnail": { "type": "media", - "multiple": true, + "multiple": false, "required": false, "allowedTypes": [ "images" @@ -30,6 +30,19 @@ "type": "component", "repeatable": true, "component": "translations.rein-costumes" + }, + "sprite": { + "allowedTypes": [ + "images" + ], + "type": "media", + "multiple": false + }, + "emblem": { + "type": "relation", + "relation": "manyToOne", + "target": "api::rein-emblem.rein-emblem", + "inversedBy": "costumes" } } } diff --git a/src/api/rein-emblem/content-types/rein-emblem/schema.json b/src/api/rein-emblem/content-types/rein-emblem/schema.json new file mode 100644 index 0000000..7d71430 --- /dev/null +++ b/src/api/rein-emblem/content-types/rein-emblem/schema.json @@ -0,0 +1,34 @@ +{ + "kind": "collectionType", + "collectionName": "rein_emblems", + "info": { + "singularName": "rein-emblem", + "pluralName": "rein-emblems", + "displayName": "⬜ Re[in] Emblems", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "attributes": { + "slug": { + "type": "string", + "required": true, + "unique": true, + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$" + }, + "translations": { + "displayName": "Rein Emblems", + "type": "component", + "repeatable": true, + "component": "translations.rein-emblems", + "required": false + }, + "costumes": { + "type": "relation", + "relation": "oneToMany", + "target": "api::rein-costume.rein-costume", + "mappedBy": "emblem" + } + } +} diff --git a/src/api/rein-emblem/controllers/rein-emblem.js b/src/api/rein-emblem/controllers/rein-emblem.js new file mode 100644 index 0000000..fe41323 --- /dev/null +++ b/src/api/rein-emblem/controllers/rein-emblem.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * rein-emblem controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::rein-emblem.rein-emblem'); diff --git a/src/api/rein-emblem/routes/rein-emblem.js b/src/api/rein-emblem/routes/rein-emblem.js new file mode 100644 index 0000000..bd44753 --- /dev/null +++ b/src/api/rein-emblem/routes/rein-emblem.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * rein-emblem router + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::rein-emblem.rein-emblem'); diff --git a/src/api/rein-emblem/services/rein-emblem.js b/src/api/rein-emblem/services/rein-emblem.js new file mode 100644 index 0000000..d3e2236 --- /dev/null +++ b/src/api/rein-emblem/services/rein-emblem.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * rein-emblem service + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::rein-emblem.rein-emblem'); diff --git a/src/components/translations/rein-emblems.json b/src/components/translations/rein-emblems.json new file mode 100644 index 0000000..4bd1a1e --- /dev/null +++ b/src/components/translations/rein-emblems.json @@ -0,0 +1,23 @@ +{ + "collectionName": "components_translations_rein_emblems", + "info": { + "displayName": "Rein Emblems", + "description": "" + }, + "options": {}, + "attributes": { + "name": { + "type": "string", + "required": true + }, + "description": { + "type": "text", + "required": true + }, + "language": { + "type": "relation", + "relation": "oneToOne", + "target": "api::language.language" + } + } +}