From fb60226bd4709fd5115f63dfd12b551fdf3d4b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 5 Jul 2026 18:39:01 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20publier=20les=20commentaires=20bokante?= =?UTF-8?q?=20import=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/__tests__/import-bokante-comments.test.js | 2 ++ src/utils/import-bokante-comments.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/utils/__tests__/import-bokante-comments.test.js b/src/utils/__tests__/import-bokante-comments.test.js index 14384aa..2110577 100644 --- a/src/utils/__tests__/import-bokante-comments.test.js +++ b/src/utils/__tests__/import-bokante-comments.test.js @@ -66,6 +66,7 @@ describe('importBokanteComments', () => { expect(bokanteMastodon.getStatusContext).toHaveBeenCalledWith('112233'); expect(strapi.documents('api::commentaire.commentaire').create).toHaveBeenCalledWith({ + status: 'published', data: expect.objectContaining({ contenu: 'Trè bèl parol !', origine: 'activitypub', @@ -80,6 +81,7 @@ describe('importBokanteComments', () => { }); expect(strapi.documents('api::parole.parole').update).toHaveBeenCalledWith({ documentId: 'doc-7', + status: 'published', data: {commentaires: {connect: expect.any(Array)}} }); expect(result.imported).toBe(1); diff --git a/src/utils/import-bokante-comments.js b/src/utils/import-bokante-comments.js index f2d9676..ab219e5 100644 --- a/src/utils/import-bokante-comments.js +++ b/src/utils/import-bokante-comments.js @@ -37,6 +37,7 @@ async function importBokanteComments({strapi}) { } const commentaire = await strapi.documents('api::commentaire.commentaire').create({ + status: 'published', data: { contenu: stripHtml(status.content), datePublication: status.created_at, @@ -58,6 +59,7 @@ async function importBokanteComments({strapi}) { if (newCommentIds.length > 0) { await strapi.documents('api::parole.parole').update({ documentId: parole.documentId, + status: 'published', data: {commentaires: {connect: newCommentIds}} }); }