From d00795ce0808006648a3b220f1c095e07881be85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Ta=C3=AFeb?= Date: Thu, 17 Oct 2024 09:04:05 +0200 Subject: [PATCH 1/2] feat: add webinaire entity --- .../content-types/webinaire/schema.json | 36 ++++++++++++++++ src/api/webinaire/controllers/webinaire.ts | 7 ++++ src/api/webinaire/routes/webinaire.ts | 7 ++++ src/api/webinaire/services/webinaire.ts | 7 ++++ types/generated/contentTypes.d.ts | 42 +++++++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 src/api/webinaire/content-types/webinaire/schema.json create mode 100644 src/api/webinaire/controllers/webinaire.ts create mode 100644 src/api/webinaire/routes/webinaire.ts create mode 100644 src/api/webinaire/services/webinaire.ts diff --git a/src/api/webinaire/content-types/webinaire/schema.json b/src/api/webinaire/content-types/webinaire/schema.json new file mode 100644 index 0000000..59c5b77 --- /dev/null +++ b/src/api/webinaire/content-types/webinaire/schema.json @@ -0,0 +1,36 @@ +{ + "kind": "collectionType", + "collectionName": "webinaires", + "info": { + "singularName": "webinaire", + "pluralName": "webinaires", + "displayName": "Webinaire" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "titre": { + "type": "string" + }, + "description": { + "type": "customField", + "options": { + "output": "HTML", + "preset": "light" + }, + "customField": "plugin::ckeditor.CKEditor" + }, + "lien_inscription": { + "type": "string", + "required": false + }, + "date_evenement": { + "type": "datetime" + }, + "lien_replay": { + "type": "string" + } + } +} diff --git a/src/api/webinaire/controllers/webinaire.ts b/src/api/webinaire/controllers/webinaire.ts new file mode 100644 index 0000000..8c45ac9 --- /dev/null +++ b/src/api/webinaire/controllers/webinaire.ts @@ -0,0 +1,7 @@ +/** + * webinaire controller + */ + +import { factories } from '@strapi/strapi' + +export default factories.createCoreController('api::webinaire.webinaire'); diff --git a/src/api/webinaire/routes/webinaire.ts b/src/api/webinaire/routes/webinaire.ts new file mode 100644 index 0000000..66bbf79 --- /dev/null +++ b/src/api/webinaire/routes/webinaire.ts @@ -0,0 +1,7 @@ +/** + * webinaire router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::webinaire.webinaire'); diff --git a/src/api/webinaire/services/webinaire.ts b/src/api/webinaire/services/webinaire.ts new file mode 100644 index 0000000..f102a0b --- /dev/null +++ b/src/api/webinaire/services/webinaire.ts @@ -0,0 +1,7 @@ +/** + * webinaire service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::webinaire.webinaire'); diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 84d9364..0196538 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -1858,6 +1858,47 @@ export interface ApiSolutionRetourExperienceSolutionRetourExperience }; } +export interface ApiWebinaireWebinaire extends Schema.CollectionType { + collectionName: 'webinaires'; + info: { + singularName: 'webinaire'; + pluralName: 'webinaires'; + displayName: 'Webinaire'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + titre: Attribute.String; + description: Attribute.RichText & + Attribute.CustomField< + 'plugin::ckeditor.CKEditor', + { + output: 'HTML'; + preset: 'light'; + } + >; + lien_inscription: Attribute.String; + date_evenement: Attribute.DateTime; + lien_replay: Attribute.String; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + publishedAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'api::webinaire.webinaire', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + updatedBy: Attribute.Relation< + 'api::webinaire.webinaire', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + }; +} + declare module '@strapi/types' { export module Shared { export interface ContentTypes { @@ -1885,6 +1926,7 @@ declare module '@strapi/types' { 'api::region.region': ApiRegionRegion; 'api::retour-experience.retour-experience': ApiRetourExperienceRetourExperience; 'api::solution-retour-experience.solution-retour-experience': ApiSolutionRetourExperienceSolutionRetourExperience; + 'api::webinaire.webinaire': ApiWebinaireWebinaire; } } } From 1dc2d9825ee4012525f7f47d49f98ead95c5e384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Ta=C3=AFeb?= Date: Thu, 17 Oct 2024 12:06:15 +0200 Subject: [PATCH 2/2] feat: add webinaire end time --- .../webinaire/content-types/webinaire/schema.json | 15 +++++++++++---- types/generated/contentTypes.d.ts | 5 ++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/api/webinaire/content-types/webinaire/schema.json b/src/api/webinaire/content-types/webinaire/schema.json index 59c5b77..39f032a 100644 --- a/src/api/webinaire/content-types/webinaire/schema.json +++ b/src/api/webinaire/content-types/webinaire/schema.json @@ -4,7 +4,8 @@ "info": { "singularName": "webinaire", "pluralName": "webinaires", - "displayName": "Webinaire" + "displayName": "Webinaire", + "description": "" }, "options": { "draftAndPublish": true @@ -26,11 +27,17 @@ "type": "string", "required": false }, - "date_evenement": { - "type": "datetime" - }, "lien_replay": { "type": "string" + }, + "jour_evenement": { + "type": "date" + }, + "heure_debut": { + "type": "time" + }, + "heure_fin": { + "type": "time" } } } diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 0196538..a8f56a7 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -1864,6 +1864,7 @@ export interface ApiWebinaireWebinaire extends Schema.CollectionType { singularName: 'webinaire'; pluralName: 'webinaires'; displayName: 'Webinaire'; + description: ''; }; options: { draftAndPublish: true; @@ -1879,8 +1880,10 @@ export interface ApiWebinaireWebinaire extends Schema.CollectionType { } >; lien_inscription: Attribute.String; - date_evenement: Attribute.DateTime; lien_replay: Attribute.String; + jour_evenement: Attribute.Date; + heure_debut: Attribute.Time; + heure_fin: Attribute.Time; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; publishedAt: Attribute.DateTime;