Filter stats, exclude draft
This commit is contained in:
@@ -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}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user