module.exports = { index: async ctx => { const result = await strapi .query('teks').find({published_at_nin: null}) const sortedResult = result.sort((a, b) => { const aDate = new Date(a.published_at) const bDate = new Date(b.published_at) return bDate.getTime() - aDate.getTime() }) ctx.send(sortedResult.map(({slug}) => slug)); } }