add tags to schema

This commit is contained in:
lightling 2024-10-17 17:11:57 -04:00
parent 68efe43fbf
commit 9ce4e38301
9 changed files with 89 additions and 72 deletions

View file

@ -0,0 +1,30 @@
{
"kind": "collectionType",
"collectionName": "media_entry_tags",
"info": {
"singularName": "media-entry-tag",
"pluralName": "media-entry-tags",
"displayName": "Media Entry Tag",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"tagId": {
"type": "string",
"required": true,
"unique": true
},
"displayName": {
"type": "string"
},
"category": {
"type": "string"
},
"description": {
"type": "text"
}
}
}

View file

@ -0,0 +1,7 @@
/**
* media-entry-tag controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::media-entry-tag.media-entry-tag');

View file

@ -0,0 +1,7 @@
/**
* media-entry-tag router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::media-entry-tag.media-entry-tag');

View file

@ -0,0 +1,7 @@
/**
* media-entry-tag service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::media-entry-tag.media-entry-tag');

View file

@ -12,12 +12,6 @@
},
"pluginOptions": {},
"attributes": {
"tags": {
"displayName": "EntryTagCollection",
"type": "component",
"repeatable": true,
"component": "default.entry-tag-collection"
},
"entries": {
"type": "relation",
"relation": "manyToMany",

View file

@ -1,18 +0,0 @@
{
"collectionName": "components_default_entry_tag_collections",
"info": {
"displayName": "EntryTagCollection"
},
"options": {},
"attributes": {
"key": {
"type": "string"
},
"value": {
"displayName": "EntryTag",
"type": "component",
"repeatable": false,
"component": "default.entry-tag"
}
}
}

View file

@ -1,15 +0,0 @@
{
"collectionName": "components_default_entry_tags",
"info": {
"displayName": "EntryTag"
},
"options": {},
"attributes": {
"category": {
"type": "string"
},
"displayName": {
"type": "string"
}
}
}

View file

@ -1,32 +1,3 @@
import type { Struct, Schema } from '@strapi/strapi';
export interface DefaultEntryTag extends Struct.ComponentSchema {
collectionName: 'components_default_entry_tags';
info: {
displayName: 'EntryTag';
};
attributes: {
category: Schema.Attribute.String;
displayName: Schema.Attribute.String;
};
}
export interface DefaultEntryTagCollection extends Struct.ComponentSchema {
collectionName: 'components_default_entry_tag_collections';
info: {
displayName: 'EntryTagCollection';
};
attributes: {
key: Schema.Attribute.String;
value: Schema.Attribute.Component<'default.entry-tag', false>;
};
}
declare module '@strapi/strapi' {
export module Public {
export interface ComponentSchemas {
'default.entry-tag': DefaultEntryTag;
'default.entry-tag-collection': DefaultEntryTagCollection;
}
}
}
/*
* The app doesn't have any components yet.
*/

View file

@ -528,6 +528,40 @@ export interface ApiMediaEntryMediaEntry extends Struct.CollectionTypeSchema {
};
}
export interface ApiMediaEntryTagMediaEntryTag
extends Struct.CollectionTypeSchema {
collectionName: 'media_entry_tags';
info: {
singularName: 'media-entry-tag';
pluralName: 'media-entry-tags';
displayName: 'Media Entry Tag';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
tagId: Schema.Attribute.String &
Schema.Attribute.Required &
Schema.Attribute.Unique;
displayName: Schema.Attribute.String;
category: Schema.Attribute.String;
description: Schema.Attribute.Text;
createdAt: Schema.Attribute.DateTime;
updatedAt: Schema.Attribute.DateTime;
publishedAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
locale: Schema.Attribute.String;
localizations: Schema.Attribute.Relation<
'oneToMany',
'api::media-entry-tag.media-entry-tag'
>;
};
}
export interface ApiMediaListMediaList extends Struct.CollectionTypeSchema {
collectionName: 'media_lists';
info: {
@ -540,7 +574,6 @@ export interface ApiMediaListMediaList extends Struct.CollectionTypeSchema {
draftAndPublish: true;
};
attributes: {
tags: Schema.Attribute.Component<'default.entry-tag-collection', true>;
entries: Schema.Attribute.Relation<
'manyToMany',
'api::media-entry.media-entry'
@ -938,6 +971,7 @@ declare module '@strapi/strapi' {
'plugin::users-permissions.role': PluginUsersPermissionsRole;
'plugin::users-permissions.user': PluginUsersPermissionsUser;
'api::media-entry.media-entry': ApiMediaEntryMediaEntry;
'api::media-entry-tag.media-entry-tag': ApiMediaEntryTagMediaEntryTag;
'api::media-list.media-list': ApiMediaListMediaList;
'admin::permission': AdminPermission;
'admin::user': AdminUser;