add project type

This commit is contained in:
Benjamin Palko 2025-08-16 12:55:04 -04:00
parent af842317e3
commit 7595d55931
6 changed files with 88 additions and 8 deletions

View file

@ -4,7 +4,8 @@
"info": { "info": {
"singularName": "project", "singularName": "project",
"pluralName": "projects", "pluralName": "projects",
"displayName": "Project" "displayName": "Project",
"description": ""
}, },
"options": { "options": {
"draftAndPublish": true "draftAndPublish": true
@ -16,12 +17,17 @@
"body": { "body": {
"type": "richtext" "type": "richtext"
}, },
"media": { "tags": {
"allowedTypes": [ "type": "relation",
"images" "relation": "manyToMany",
], "target": "api::tag.tag",
"type": "media", "inversedBy": "projects"
"multiple": false },
"url": {
"type": "string"
},
"embed": {
"type": "string"
} }
} }
} }

View file

@ -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"
}
}
}

View file

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

View file

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

View file

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

View file

@ -366,6 +366,7 @@ export interface ApiBlogBlog extends Struct.CollectionTypeSchema {
export interface ApiProjectProject extends Struct.CollectionTypeSchema { export interface ApiProjectProject extends Struct.CollectionTypeSchema {
collectionName: 'projects'; collectionName: 'projects';
info: { info: {
description: '';
displayName: 'Project'; displayName: 'Project';
pluralName: 'projects'; pluralName: 'projects';
singularName: 'project'; singularName: 'project';
@ -377,14 +378,41 @@ export interface ApiProjectProject extends Struct.CollectionTypeSchema {
body: Schema.Attribute.RichText; body: Schema.Attribute.RichText;
createdAt: Schema.Attribute.DateTime; createdAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private;
embed: Schema.Attribute.String;
locale: Schema.Attribute.String & Schema.Attribute.Private; locale: Schema.Attribute.String & Schema.Attribute.Private;
localizations: Schema.Attribute.Relation<'oneToMany', 'api::project.project'> & localizations: Schema.Attribute.Relation<'oneToMany', 'api::project.project'> &
Schema.Attribute.Private; Schema.Attribute.Private;
media: Schema.Attribute.Media<'images'>;
publishedAt: Schema.Attribute.DateTime; publishedAt: Schema.Attribute.DateTime;
tags: Schema.Attribute.Relation<'manyToMany', 'api::tag.tag'>;
title: Schema.Attribute.String; title: Schema.Attribute.String;
updatedAt: Schema.Attribute.DateTime; updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; 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; 'admin::user': AdminUser;
'api::blog.blog': ApiBlogBlog; 'api::blog.blog': ApiBlogBlog;
'api::project.project': ApiProjectProject; 'api::project.project': ApiProjectProject;
'api::tag.tag': ApiTagTag;
'plugin::content-releases.release': PluginContentReleasesRelease; 'plugin::content-releases.release': PluginContentReleasesRelease;
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction; 'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
'plugin::i18n.locale': PluginI18NLocale; 'plugin::i18n.locale': PluginI18NLocale;