Enabled multiple categories for weapons stories and glossary

This commit is contained in:
DrMint 2021-12-21 22:47:50 +01:00
parent ce842f0baf
commit edfcff5b35
8 changed files with 79 additions and 16 deletions

View File

@ -36,11 +36,12 @@
"target": "api::glossary-item-type.glossary-item-type" "target": "api::glossary-item-type.glossary-item-type"
}, },
"thumbnail": { "thumbnail": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [ "allowedTypes": [
"images" "images"
], ]
"type": "media",
"multiple": false
} }
} }
} }

View File

@ -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]+)*$"
}
}
}

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -35,11 +35,18 @@
"target": "api::weapon-story-type.weapon-story-type" "target": "api::weapon-story-type.weapon-story-type"
}, },
"thumbnail": { "thumbnail": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [ "allowedTypes": [
"images" "images"
], ]
"type": "media", },
"multiple": false "weapon_group": {
"type": "relation",
"relation": "manyToOne",
"target": "api::weapon-story-group.weapon-story-group",
"inversedBy": "weapons"
} }
} }
} }

View File

@ -7,11 +7,6 @@
}, },
"options": {}, "options": {},
"attributes": { "attributes": {
"category": {
"type": "relation",
"relation": "oneToOne",
"target": "api::category.category"
},
"translations": { "translations": {
"displayName": "Glossary Definition", "displayName": "Glossary Definition",
"type": "component", "type": "component",
@ -22,6 +17,11 @@
"type": "relation", "type": "relation",
"relation": "oneToOne", "relation": "oneToOne",
"target": "api::source.source" "target": "api::source.source"
},
"categories": {
"type": "relation",
"relation": "oneToMany",
"target": "api::category.category"
} }
} }
} }

View File

@ -14,15 +14,15 @@
"component": "translations.weapon-story-story", "component": "translations.weapon-story-story",
"required": false "required": false
}, },
"category": {
"type": "relation",
"relation": "oneToOne",
"target": "api::category.category"
},
"source": { "source": {
"type": "relation", "type": "relation",
"relation": "oneToOne", "relation": "oneToOne",
"target": "api::source.source" "target": "api::source.source"
},
"categories": {
"type": "relation",
"relation": "oneToMany",
"target": "api::category.category"
} }
} }
} }