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 MESSAGE_URL = `${TELEGRAM_API_URL}/bot${TELEGRAM_API_TOKEN}/sendMessage?chat_id=${TELEGRAM_CHAN_ID}&parse_mode=html`
|
||||||
|
|
||||||
const jwennAwtisEpiId = async data => {
|
const jwennAwtisEpiId = async data => {
|
||||||
const awtis = await strapi.query('awtis').find({id: data})
|
const artiste = await strapi.query('artiste').find({id: data})
|
||||||
return awtis.map(a => a.alias).join('-')
|
return artiste.map(a => a.alias).join('-')
|
||||||
}
|
}
|
||||||
|
|
||||||
const jwennUserEpiId = async userId => {
|
const jwennUserEpiId = async userId => {
|
||||||
@@ -57,8 +57,8 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data.tit && !data.forceSlug) {
|
if (data.tit && !data.forceSlug) {
|
||||||
const awtis = await jwennAwtisEpiId(data.awtis)
|
const artiste = await jwennAwtisEpiId(data.artiste)
|
||||||
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
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)) {
|
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
|
let {data} = event
|
||||||
|
|
||||||
if (data.tit && !data.forceSlug) {
|
if (data.tit && !data.forceSlug) {
|
||||||
const awtis = await jwennAwtisEpiId(data.awtis)
|
const artiste = await jwennAwtisEpiId(data.artiste)
|
||||||
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
data.slug = slugify(`${artiste}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||||
}
|
}
|
||||||
if (data.published_at != null) {
|
if (data.published_at != null) {
|
||||||
const {id} = params
|
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 previousPublishedAt = previousData.published_at
|
||||||
const currentPublished_at = data.published_at
|
const currentPublished_at = data.published_at
|
||||||
+7
-7
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"kind": "collectionType",
|
"kind": "collectionType",
|
||||||
"collectionName": "teks",
|
"collectionName": "paroles",
|
||||||
"info": {
|
"info": {
|
||||||
"singularName": "tek",
|
"singularName": "parole",
|
||||||
"pluralName": "teks",
|
"pluralName": "paroles",
|
||||||
"displayName": "Teks",
|
"displayName": "Paroles",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
@@ -38,11 +38,11 @@
|
|||||||
"tradiksyonOtomatik": {
|
"tradiksyonOtomatik": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"awtis": {
|
"artistes": {
|
||||||
"type": "relation",
|
"type": "relation",
|
||||||
"relation": "manyToMany",
|
"relation": "manyToMany",
|
||||||
"target": "api::awti.awti",
|
"target": "api::parole.parole",
|
||||||
"mappedBy": "teks"
|
"mappedBy": "paroles"
|
||||||
},
|
},
|
||||||
"admin_user": {
|
"admin_user": {
|
||||||
"type": "relation",
|
"type": "relation",
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
const { createCoreController } = require('@strapi/strapi').factories;
|
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;
|
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;
|
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