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');
|
||||
Reference in New Issue
Block a user