Added Tag schema.
This commit is contained in:
parent
2a2fdaf7ef
commit
644d9743a9
|
|
@ -4,7 +4,8 @@
|
||||||
"info": {
|
"info": {
|
||||||
"singularName": "product",
|
"singularName": "product",
|
||||||
"pluralName": "products",
|
"pluralName": "products",
|
||||||
"displayName": "Product"
|
"displayName": "Product",
|
||||||
|
"description": ""
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"draftAndPublish": true
|
"draftAndPublish": true
|
||||||
|
|
@ -66,6 +67,12 @@
|
||||||
"relation": "manyToMany",
|
"relation": "manyToMany",
|
||||||
"target": "api::category.category",
|
"target": "api::category.category",
|
||||||
"inversedBy": "products"
|
"inversedBy": "products"
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"type": "relation",
|
||||||
|
"relation": "manyToMany",
|
||||||
|
"target": "api::tag.tag",
|
||||||
|
"inversedBy": "products"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
34
src/api/tag/content-types/tag/schema.json
Normal file
34
src/api/tag/content-types/tag/schema.json
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"kind": "collectionType",
|
||||||
|
"collectionName": "tags",
|
||||||
|
"info": {
|
||||||
|
"singularName": "tag",
|
||||||
|
"pluralName": "tags",
|
||||||
|
"displayName": "Tag",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"draftAndPublish": true
|
||||||
|
},
|
||||||
|
"pluginOptions": {
|
||||||
|
"i18n": {
|
||||||
|
"localized": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"slug": {
|
||||||
|
"pluginOptions": {
|
||||||
|
"i18n": {
|
||||||
|
"localized": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"products": {
|
||||||
|
"type": "relation",
|
||||||
|
"relation": "manyToMany",
|
||||||
|
"target": "api::product.product",
|
||||||
|
"mappedBy": "tags"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/api/tag/controllers/tag.ts
Normal file
7
src/api/tag/controllers/tag.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**
|
||||||
|
* tag controller
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi'
|
||||||
|
|
||||||
|
export default factories.createCoreController('api::tag.tag');
|
||||||
7
src/api/tag/routes/tag.ts
Normal file
7
src/api/tag/routes/tag.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**
|
||||||
|
* tag router
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreRouter('api::tag.tag');
|
||||||
7
src/api/tag/services/tag.ts
Normal file
7
src/api/tag/services/tag.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**
|
||||||
|
* tag service
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreService('api::tag.tag');
|
||||||
Loading…
Reference in New Issue
Block a user