Filter stats, exclude draft
This commit is contained in:
@@ -3,13 +3,22 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
async count(ctx, next) {
|
async count(ctx, next) {
|
||||||
const countArtiste = await strapi.entityService.count('api::artiste.artiste')
|
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', {
|
const countParoleWithoutFrancais = await strapi.entityService.count('api::parole.parole', {
|
||||||
filters: {
|
filters: {
|
||||||
traductions: {
|
traductions: {
|
||||||
francais: {
|
francais: {
|
||||||
$null: true
|
$null: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
publishedAt: {
|
||||||
|
$notNull: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -20,6 +29,9 @@ module.exports = {
|
|||||||
anglais: {
|
anglais: {
|
||||||
$null: true
|
$null: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
publishedAt: {
|
||||||
|
$notNull: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -30,6 +42,9 @@ module.exports = {
|
|||||||
espagnol: {
|
espagnol: {
|
||||||
$null: true
|
$null: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
publishedAt: {
|
||||||
|
$notNull: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -40,6 +55,9 @@ module.exports = {
|
|||||||
allemand: {
|
allemand: {
|
||||||
$null: true
|
$null: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
publishedAt: {
|
||||||
|
$notNull: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -50,6 +68,9 @@ module.exports = {
|
|||||||
italien: {
|
italien: {
|
||||||
$null: true
|
$null: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
publishedAt: {
|
||||||
|
$notNull: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -70,7 +91,6 @@ module.exports = {
|
|||||||
italien: countParoleWithoutItalien,
|
italien: countParoleWithoutItalien,
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('artisteWithoutBio', artistesWithoutBio)
|
|
||||||
return {countArtiste, countParole, artistesWithoutBio, parolesWithoutTranslation}
|
return {countArtiste, countParole, artistesWithoutBio, parolesWithoutTranslation}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user