diff --git a/strapi/src/api/project/content-types/project/schema.json b/strapi/src/api/project/content-types/project/schema.json index a086363..ff27e94 100644 --- a/strapi/src/api/project/content-types/project/schema.json +++ b/strapi/src/api/project/content-types/project/schema.json @@ -4,7 +4,8 @@ "info": { "singularName": "project", "pluralName": "projects", - "displayName": "Project" + "displayName": "Project", + "description": "" }, "options": { "draftAndPublish": true @@ -16,12 +17,17 @@ "body": { "type": "richtext" }, - "media": { - "allowedTypes": [ - "images" - ], - "type": "media", - "multiple": false + "tags": { + "type": "relation", + "relation": "manyToMany", + "target": "api::tag.tag", + "inversedBy": "projects" + }, + "url": { + "type": "string" + }, + "embed": { + "type": "string" } } } diff --git a/strapi/src/api/tag/content-types/tag/schema.json b/strapi/src/api/tag/content-types/tag/schema.json new file mode 100644 index 0000000..be610db --- /dev/null +++ b/strapi/src/api/tag/content-types/tag/schema.json @@ -0,0 +1,24 @@ +{ + "kind": "collectionType", + "collectionName": "tags", + "info": { + "singularName": "tag", + "pluralName": "tags", + "displayName": "Tag", + "description": "" + }, + "options": { + "draftAndPublish": true + }, + "attributes": { + "value": { + "type": "string" + }, + "projects": { + "type": "relation", + "relation": "manyToMany", + "target": "api::project.project", + "mappedBy": "tags" + } + } +} diff --git a/strapi/src/api/tag/controllers/tag.ts b/strapi/src/api/tag/controllers/tag.ts new file mode 100644 index 0000000..0b3e997 --- /dev/null +++ b/strapi/src/api/tag/controllers/tag.ts @@ -0,0 +1,7 @@ +/** + * tag controller + */ + +import { factories } from '@strapi/strapi' + +export default factories.createCoreController('api::tag.tag'); diff --git a/strapi/src/api/tag/routes/tag.ts b/strapi/src/api/tag/routes/tag.ts new file mode 100644 index 0000000..d15b0cf --- /dev/null +++ b/strapi/src/api/tag/routes/tag.ts @@ -0,0 +1,7 @@ +/** + * tag router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::tag.tag'); diff --git a/strapi/src/api/tag/services/tag.ts b/strapi/src/api/tag/services/tag.ts new file mode 100644 index 0000000..d45b676 --- /dev/null +++ b/strapi/src/api/tag/services/tag.ts @@ -0,0 +1,7 @@ +/** + * tag service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::tag.tag'); diff --git a/strapi/types/generated/contentTypes.d.ts b/strapi/types/generated/contentTypes.d.ts index 53bc4f0..8369d86 100644 --- a/strapi/types/generated/contentTypes.d.ts +++ b/strapi/types/generated/contentTypes.d.ts @@ -366,6 +366,7 @@ export interface ApiBlogBlog extends Struct.CollectionTypeSchema { export interface ApiProjectProject extends Struct.CollectionTypeSchema { collectionName: 'projects'; info: { + description: ''; displayName: 'Project'; pluralName: 'projects'; singularName: 'project'; @@ -377,14 +378,41 @@ export interface ApiProjectProject extends Struct.CollectionTypeSchema { body: Schema.Attribute.RichText; createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + embed: Schema.Attribute.String; locale: Schema.Attribute.String & Schema.Attribute.Private; localizations: Schema.Attribute.Relation<'oneToMany', 'api::project.project'> & Schema.Attribute.Private; - media: Schema.Attribute.Media<'images'>; publishedAt: Schema.Attribute.DateTime; + tags: Schema.Attribute.Relation<'manyToMany', 'api::tag.tag'>; title: Schema.Attribute.String; updatedAt: Schema.Attribute.DateTime; updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + url: Schema.Attribute.String; + }; +} + +export interface ApiTagTag extends Struct.CollectionTypeSchema { + collectionName: 'tags'; + info: { + description: ''; + displayName: 'Tag'; + pluralName: 'tags'; + singularName: 'tag'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation<'oneToMany', 'api::tag.tag'> & + Schema.Attribute.Private; + projects: Schema.Attribute.Relation<'manyToMany', 'api::project.project'>; + publishedAt: Schema.Attribute.DateTime; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + value: Schema.Attribute.String; }; } @@ -817,6 +845,7 @@ declare module '@strapi/strapi' { 'admin::user': AdminUser; 'api::blog.blog': ApiBlogBlog; 'api::project.project': ApiProjectProject; + 'api::tag.tag': ApiTagTag; 'plugin::content-releases.release': PluginContentReleasesRelease; 'plugin::content-releases.release-action': PluginContentReleasesReleaseAction; 'plugin::i18n.locale': PluginI18NLocale;