From 29bdf72640aab6d89d154b48605fa2ae5ae8314f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 5 Jul 2026 19:04:39 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20r=C3=A9parer=20la=20relation=20commentai?= =?UTF-8?q?re.parole=20/=20parole.commentaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/commentaire/content-types/commentaire/schema.json | 5 +++-- src/api/parole/content-types/parole/schema.json | 3 ++- types/generated/contentTypes.d.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/commentaire/content-types/commentaire/schema.json b/src/api/commentaire/content-types/commentaire/schema.json index c3887bb..c12f4c6 100644 --- a/src/api/commentaire/content-types/commentaire/schema.json +++ b/src/api/commentaire/content-types/commentaire/schema.json @@ -27,8 +27,9 @@ }, "parole": { "type": "relation", - "relation": "oneToOne", - "target": "api::parole.parole" + "relation": "manyToOne", + "target": "api::parole.parole", + "inversedBy": "commentaires" }, "origine": { "type": "enumeration", diff --git a/src/api/parole/content-types/parole/schema.json b/src/api/parole/content-types/parole/schema.json index 6083ba1..f1251dd 100644 --- a/src/api/parole/content-types/parole/schema.json +++ b/src/api/parole/content-types/parole/schema.json @@ -82,7 +82,8 @@ "commentaires": { "type": "relation", "relation": "oneToMany", - "target": "api::commentaire.commentaire" + "target": "api::commentaire.commentaire", + "mappedBy": "parole" }, "prioriteArtistes": { "type": "string" diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index da8a7d3..a9452f2 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -506,7 +506,7 @@ export interface ApiCommentaireCommentaire extends Struct.CollectionTypeSchema { origine: Schema.Attribute.Enumeration<['local', 'activitypub']> & Schema.Attribute.Required & Schema.Attribute.DefaultTo<'local'>; - parole: Schema.Attribute.Relation<'oneToOne', 'api::parole.parole'>; + parole: Schema.Attribute.Relation<'manyToOne', 'api::parole.parole'>; publishedAt: Schema.Attribute.DateTime; remoteId: Schema.Attribute.String & Schema.Attribute.Unique; remoteUrl: Schema.Attribute.String;