Replace _id by id

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-05 20:20:00 +04:00
parent a9f2be20d5
commit bb0bfdb89d
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -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}
)
}