Replace _id by id
This commit is contained in:
@@ -9,7 +9,7 @@ const TELEGRAM_API_TOKEN = process.env.TELEGRAM_API_TOKEN || null
|
||||
const MESSAGE_URL = `${TELEGRAM_API_URL}/bot${TELEGRAM_API_TOKEN}/sendMessage?chat_id=${TELEGRAM_CHAN_ID}&parse_mode=html`
|
||||
|
||||
const jwennAwtisEpiId = async data => {
|
||||
const awtis = await strapi.query('awtis').find({_id: data})
|
||||
const awtis = await strapi.query('awtis').find({id: data})
|
||||
return awtis.map(a => a.alias).join('-')
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ module.exports = {
|
||||
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
}
|
||||
if (data.published_at != null) {
|
||||
const {_id} = params
|
||||
const previousData = await strapi.query('teks').findOne({_id})
|
||||
const {id} = params
|
||||
const previousData = await strapi.query('teks').findOne({id})
|
||||
|
||||
const previousPublishedAt = previousData.published_at
|
||||
const currentPublished_at = data.published_at
|
||||
|
||||
Reference in New Issue
Block a user