Exclude draft from '/slugs'

This commit is contained in:
2020-12-23 23:17:58 +01:00
parent 0711e16b2e
commit 16e5769b7a
+1 -1
View File
@@ -2,7 +2,7 @@ module.exports = {
index: async ctx => {
const result = await strapi
.query('teks')
.model.find({})
.model.find({published_at: {$ne: null}})
const sortedResult = result.sort((a, b) => {
const aDate = new Date(a.published_at)
const bDate = new Date(b.published_at)