diff --git a/src/api/glossary-item/content-types/glossary-item/schema.json b/src/api/glossary-item/content-types/glossary-item/schema.json index 870a555..11a2fa8 100644 --- a/src/api/glossary-item/content-types/glossary-item/schema.json +++ b/src/api/glossary-item/content-types/glossary-item/schema.json @@ -36,11 +36,12 @@ "target": "api::glossary-item-type.glossary-item-type" }, "thumbnail": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images" - ], - "type": "media", - "multiple": false + ] } } } diff --git a/src/api/weapon-story-group/content-types/weapon-story-group/schema.json b/src/api/weapon-story-group/content-types/weapon-story-group/schema.json new file mode 100644 index 0000000..1954c05 --- /dev/null +++ b/src/api/weapon-story-group/content-types/weapon-story-group/schema.json @@ -0,0 +1,28 @@ +{ + "kind": "collectionType", + "collectionName": "weapon_story_groups", + "info": { + "singularName": "weapon-story-group", + "pluralName": "weapon-story-groups", + "displayName": "🟤 Weapon Story Groups", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "weapons": { + "type": "relation", + "relation": "oneToMany", + "target": "api::weapon-story.weapon-story", + "mappedBy": "weapon_group" + }, + "slug": { + "type": "string", + "required": true, + "unique": true, + "regex": "^[a-z0-9]+(?:-[a-z0-9]+)*$" + } + } +} diff --git a/src/api/weapon-story-group/controllers/weapon-story-group.js b/src/api/weapon-story-group/controllers/weapon-story-group.js new file mode 100644 index 0000000..9198023 --- /dev/null +++ b/src/api/weapon-story-group/controllers/weapon-story-group.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * weapon-story-group controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::weapon-story-group.weapon-story-group'); diff --git a/src/api/weapon-story-group/routes/weapon-story-group.js b/src/api/weapon-story-group/routes/weapon-story-group.js new file mode 100644 index 0000000..6a37e80 --- /dev/null +++ b/src/api/weapon-story-group/routes/weapon-story-group.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * weapon-story-group router. + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::weapon-story-group.weapon-story-group'); diff --git a/src/api/weapon-story-group/services/weapon-story-group.js b/src/api/weapon-story-group/services/weapon-story-group.js new file mode 100644 index 0000000..6d6b564 --- /dev/null +++ b/src/api/weapon-story-group/services/weapon-story-group.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * weapon-story-group service. + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::weapon-story-group.weapon-story-group'); diff --git a/src/api/weapon-story/content-types/weapon-story/schema.json b/src/api/weapon-story/content-types/weapon-story/schema.json index cca53fd..f361a4c 100644 --- a/src/api/weapon-story/content-types/weapon-story/schema.json +++ b/src/api/weapon-story/content-types/weapon-story/schema.json @@ -35,11 +35,18 @@ "target": "api::weapon-story-type.weapon-story-type" }, "thumbnail": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images" - ], - "type": "media", - "multiple": false + ] + }, + "weapon_group": { + "type": "relation", + "relation": "manyToOne", + "target": "api::weapon-story-group.weapon-story-group", + "inversedBy": "weapons" } } } diff --git a/src/components/collections-component/glossary-definition.json b/src/components/collections-component/glossary-definition.json index d2356a3..c8918ed 100644 --- a/src/components/collections-component/glossary-definition.json +++ b/src/components/collections-component/glossary-definition.json @@ -7,11 +7,6 @@ }, "options": {}, "attributes": { - "category": { - "type": "relation", - "relation": "oneToOne", - "target": "api::category.category" - }, "translations": { "displayName": "Glossary Definition", "type": "component", @@ -22,6 +17,11 @@ "type": "relation", "relation": "oneToOne", "target": "api::source.source" + }, + "categories": { + "type": "relation", + "relation": "oneToMany", + "target": "api::category.category" } } } diff --git a/src/components/collections-component/weapon-story.json b/src/components/collections-component/weapon-story.json index 1ccd2ed..e8adda3 100644 --- a/src/components/collections-component/weapon-story.json +++ b/src/components/collections-component/weapon-story.json @@ -14,15 +14,15 @@ "component": "translations.weapon-story-story", "required": false }, - "category": { - "type": "relation", - "relation": "oneToOne", - "target": "api::category.category" - }, "source": { "type": "relation", "relation": "oneToOne", "target": "api::source.source" + }, + "categories": { + "type": "relation", + "relation": "oneToMany", + "target": "api::category.category" } } }