Skip to content

Commit

Permalink
fix(dashboard): ré-évalue le nombre de commentaires qui sont en fait …
Browse files Browse the repository at this point in the history
…un historique de personne suivie
  • Loading branch information
Arnaud AMBROSELLI committed Oct 2, 2023
1 parent 50149bd commit c0e839b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dashboard/src/components/DataMigrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function useDataMigrator() {
}
}

if (!organisation.migrations?.includes('evaluate-comments-in-persons-history')) {
if (!organisation.migrations?.includes('re-evaluate-comments-in-persons-history')) {
setLoadingText(LOADING_TEXT);
const comments = await API.get({
path: '/comment',
Expand All @@ -131,16 +131,18 @@ export default function useDataMigrator() {
return true;
});

const earlisestComment = personHistoryComments[personHistoryComments.length - 1]?.createdAt?.split('T')[0];
const latestComment = personHistoryComments[0]?.createdAt?.split('T')[0];
capture(
`Evaluate comments in persons history: ${organisation.name} - ${comments.length} coms - ${personHistoryComments.length} hist - ${persons.length} persons`,
`ECOMHISTFORCSV: ${organisation._id},${comments.length},${personHistoryComments.length},${persons.length},${earlisestComment},${latestComment}`,
{
extra: {
organisationId,
'total-comments': comments.length,
'total-history-comments': personHistoryComments.length,
'total-persons': persons.length,
'earliest-comment': personHistoryComments[personHistoryComments.length - 1]?.createdAt,
'latest-comment': personHistoryComments[0]?.createdAt,
'earliest-comment': earlisestComment,
'latest-comment': latestComment,
},
}
);
Expand Down

0 comments on commit c0e839b

Please sign in to comment.