Add forceSlug to teks
This commit is contained in:
@@ -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})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user