fix: publier les commentaires bokante importés
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user