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}} }); }