Add calendar type
This commit is contained in:
@@ -61,6 +61,12 @@
|
||||
"relation": "oneToMany",
|
||||
"target": "api::board.board",
|
||||
"mappedBy": "choral"
|
||||
},
|
||||
"calendar": {
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::event.event",
|
||||
"mappedBy": "choral"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
34
src/api/event/content-types/event/schema.json
Normal file
34
src/api/event/content-types/event/schema.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "events",
|
||||
"info": {
|
||||
"singularName": "event",
|
||||
"pluralName": "events",
|
||||
"displayName": "Event",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": false
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"start": {
|
||||
"type": "datetime"
|
||||
},
|
||||
"end": {
|
||||
"type": "datetime"
|
||||
},
|
||||
"color": {
|
||||
"type": "string"
|
||||
},
|
||||
"choral": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::choral.choral",
|
||||
"inversedBy": "calendar"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/event/controllers/event.ts
Normal file
7
src/api/event/controllers/event.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* event controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::event.event');
|
||||
7
src/api/event/routes/event.ts
Normal file
7
src/api/event/routes/event.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* event router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::event.event');
|
||||
7
src/api/event/services/event.ts
Normal file
7
src/api/event/services/event.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* event service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::event.event');
|
||||
32
types/generated/contentTypes.d.ts
vendored
32
types/generated/contentTypes.d.ts
vendored
@@ -493,6 +493,7 @@ export interface ApiChoralChoral extends Struct.CollectionTypeSchema {
|
||||
'plugin::users-permissions.user'
|
||||
>;
|
||||
boards: Schema.Attribute.Relation<'oneToMany', 'api::board.board'>;
|
||||
calendar: Schema.Attribute.Relation<'oneToMany', 'api::event.event'>;
|
||||
city: Schema.Attribute.String;
|
||||
country: Schema.Attribute.String;
|
||||
cover: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
|
||||
@@ -522,6 +523,36 @@ export interface ApiChoralChoral extends Struct.CollectionTypeSchema {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiEventEvent extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'events';
|
||||
info: {
|
||||
description: '';
|
||||
displayName: 'Event';
|
||||
pluralName: 'events';
|
||||
singularName: 'event';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: false;
|
||||
};
|
||||
attributes: {
|
||||
choral: Schema.Attribute.Relation<'manyToOne', 'api::choral.choral'>;
|
||||
color: Schema.Attribute.String;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
end: Schema.Attribute.DateTime;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<'oneToMany', 'api::event.event'> &
|
||||
Schema.Attribute.Private;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
start: Schema.Attribute.DateTime;
|
||||
title: Schema.Attribute.String;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginContentReleasesRelease
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'strapi_releases';
|
||||
@@ -1042,6 +1073,7 @@ declare module '@strapi/strapi' {
|
||||
'api::board-list.board-list': ApiBoardListBoardList;
|
||||
'api::board.board': ApiBoardBoard;
|
||||
'api::choral.choral': ApiChoralChoral;
|
||||
'api::event.event': ApiEventEvent;
|
||||
'plugin::content-releases.release': PluginContentReleasesRelease;
|
||||
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
|
||||
'plugin::i18n.locale': PluginI18NLocale;
|
||||
|
||||
Reference in New Issue
Block a user