Add forceSlug to teks
This commit is contained in:
@@ -666,6 +666,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -627,6 +627,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -832,6 +832,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@@ -966,6 +969,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
|
||||
@@ -16,13 +16,13 @@ const jwennAwtisEpiId = async data => {
|
||||
module.exports = {
|
||||
lifecycles: {
|
||||
beforeCreate: async data => {
|
||||
if (data.tit) {
|
||||
if (data.tit && !data.forceSlug) {
|
||||
const awtis = await jwennAwtisEpiId(data.awtis)
|
||||
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
}
|
||||
},
|
||||
beforeUpdate: async (params, data) => {
|
||||
if (data.tit) {
|
||||
if (data.tit && !data.forceSlug) {
|
||||
const awtis = await jwennAwtisEpiId(data.awtis)
|
||||
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@
|
||||
"komante": {
|
||||
"via": "teks",
|
||||
"collection": "komante"
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"url": "https://o-k-i.net"
|
||||
},
|
||||
"license": null,
|
||||
"x-generation-date": "03/22/2022 6:55:51 AM"
|
||||
"x-generation-date": "03/23/2022 8:55:05 AM"
|
||||
},
|
||||
"x-strapi-config": {
|
||||
"path": "/dokiman",
|
||||
@@ -1511,6 +1511,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -1729,6 +1732,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -2099,6 +2105,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@@ -2233,6 +2242,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"forceSlug": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
|
||||
Reference in New Issue
Block a user