Filter stats, exclude draft

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-26 03:04:33 +04:00
parent 924869995e
commit 4f5aab0ace
+22 -2
View File
@@ -3,13 +3,22 @@
module.exports = {
async count(ctx, next) {
const countArtiste = await strapi.entityService.count('api::artiste.artiste')
const countParole = await strapi.entityService.count('api::parole.parole')
const countParole = await strapi.entityService.count('api::parole.parole', {
filters: {
publishedAt: {
$notNull: true,
}
}
})
const countParoleWithoutFrancais = await strapi.entityService.count('api::parole.parole', {
filters: {
traductions: {
francais: {
$null: true
}
},
publishedAt: {
$notNull: true,
}
}
})
@@ -20,6 +29,9 @@ module.exports = {
anglais: {
$null: true
}
},
publishedAt: {
$notNull: true,
}
}
})
@@ -30,6 +42,9 @@ module.exports = {
espagnol: {
$null: true
}
},
publishedAt: {
$notNull: true,
}
}
})
@@ -40,6 +55,9 @@ module.exports = {
allemand: {
$null: true
}
},
publishedAt: {
$notNull: true,
}
}
})
@@ -50,6 +68,9 @@ module.exports = {
italien: {
$null: true
}
},
publishedAt: {
$notNull: true,
}
}
})
@@ -70,7 +91,6 @@ module.exports = {
italien: countParoleWithoutItalien,
}
console.log('artisteWithoutBio', artistesWithoutBio)
return {countArtiste, countParole, artistesWithoutBio, parolesWithoutTranslation}
}
}