Rename tek to parole
This commit is contained in:
+7
-7
@@ -9,8 +9,8 @@ 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})
|
||||
return awtis.map(a => a.alias).join('-')
|
||||
const artiste = await strapi.query('artiste').find({id: data})
|
||||
return artiste.map(a => a.alias).join('-')
|
||||
}
|
||||
|
||||
const jwennUserEpiId = async userId => {
|
||||
@@ -57,8 +57,8 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (data.tit && !data.forceSlug) {
|
||||
const awtis = await jwennAwtisEpiId(data.awtis)
|
||||
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
const artiste = await jwennAwtisEpiId(data.artiste)
|
||||
data.slug = slugify(`${artiste}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
}
|
||||
|
||||
if (user && user.canAutoTranslate && data.tradiksyonOtomatik && data.tradiksyon.francais && (!data.tradiksyon.english || !data.tradiksyon.espagnol || !data.tradiksyon.deutsch || !data.tradiksyon.italiano)) {
|
||||
@@ -71,12 +71,12 @@ module.exports = {
|
||||
let {data} = event
|
||||
|
||||
if (data.tit && !data.forceSlug) {
|
||||
const awtis = await jwennAwtisEpiId(data.awtis)
|
||||
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
const artiste = await jwennAwtisEpiId(data.artiste)
|
||||
data.slug = slugify(`${artiste}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
}
|
||||
if (data.published_at != null) {
|
||||
const {id} = params
|
||||
const previousData = await strapi.query('teks').findOne({id})
|
||||
const previousData = await strapi.query('paroles').findOne({id})
|
||||
|
||||
const previousPublishedAt = previousData.published_at
|
||||
const currentPublished_at = data.published_at
|
||||
+7
-7
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "teks",
|
||||
"collectionName": "paroles",
|
||||
"info": {
|
||||
"singularName": "tek",
|
||||
"pluralName": "teks",
|
||||
"displayName": "Teks",
|
||||
"singularName": "parole",
|
||||
"pluralName": "paroles",
|
||||
"displayName": "Paroles",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
@@ -38,11 +38,11 @@
|
||||
"tradiksyonOtomatik": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"awtis": {
|
||||
"artistes": {
|
||||
"type": "relation",
|
||||
"relation": "manyToMany",
|
||||
"target": "api::awti.awti",
|
||||
"mappedBy": "teks"
|
||||
"target": "api::parole.parole",
|
||||
"mappedBy": "paroles"
|
||||
},
|
||||
"admin_user": {
|
||||
"type": "relation",
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
const { createCoreController } = require('@strapi/strapi').factories;
|
||||
|
||||
module.exports = createCoreController('api::tek.tek')
|
||||
module.exports = createCoreController('api::parole.parole')
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
const { createCoreRouter } = require('@strapi/strapi').factories;
|
||||
|
||||
module.exports = createCoreRouter('api::tek.tek')
|
||||
module.exports = createCoreRouter('api::parole.parole')
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
const { createCoreService } = require('@strapi/strapi').factories;
|
||||
|
||||
module.exports = createCoreService('api::tek.tek');
|
||||
module.exports = createCoreService('api::parole.parole');
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user