Replace _id by id
This commit is contained in:
@@ -19,12 +19,12 @@ module.exports = {
|
||||
if (values.teks && values.teks.length >= 1) {
|
||||
const teks = await jwennTeksEpiId(values.teks)
|
||||
Promise.all(teks.map(async t => {
|
||||
const {_id, tit, slug, awtis} = t
|
||||
const {id, tit, slug, awtis} = t
|
||||
const alias = awtis.map(a => a.alias).join('-')
|
||||
const slugUpdated = slugify(`${alias}-${tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
if (slug !== slugUpdated) {
|
||||
await strapi.query('teks').update(
|
||||
{_id},
|
||||
{id},
|
||||
{slug: slugUpdated}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user