Add slug to awtis
This commit is contained in:
@@ -735,6 +735,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@@ -771,6 +774,9 @@
|
||||
"user": {
|
||||
"type": "string"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
|
||||
@@ -19,6 +19,14 @@ const jwennAwtisEpiId = async id => {
|
||||
|
||||
module.exports = {
|
||||
lifecycles: {
|
||||
beforeUpdate: async (params, data) => {
|
||||
if (!data.slug) {
|
||||
data.slug = slugify(data.alias, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
}
|
||||
},
|
||||
beforeCreate: async data => {
|
||||
data.slug = slugify(data.alias, {lower: true, remove: /[*#+~.()'"!:@]/g})
|
||||
},
|
||||
afterUpdate: async (params, data) => {
|
||||
const {id} = data
|
||||
const awtis = await jwennAwtisEpiId(id)
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
"user": {
|
||||
"plugin": "users-permissions",
|
||||
"model": "user"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -631,6 +631,9 @@
|
||||
"user": {
|
||||
"type": "string"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
"component": "url.liens"
|
||||
},
|
||||
"awtis": {
|
||||
"collection": "awtis",
|
||||
"via": "teks",
|
||||
"collection": "awtis",
|
||||
"dominant": true
|
||||
},
|
||||
"kouteyAchtey": {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"url": "https://o-k-i.net"
|
||||
},
|
||||
"license": null,
|
||||
"x-generation-date": "05/08/2022 3:50:47 AM"
|
||||
"x-generation-date": "05/10/2022 9:18:59 PM"
|
||||
},
|
||||
"x-strapi-config": {
|
||||
"path": "/dokiman",
|
||||
@@ -1580,6 +1580,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@@ -1616,6 +1619,9 @@
|
||||
"user": {
|
||||
"type": "string"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@@ -1922,6 +1928,9 @@
|
||||
"user": {
|
||||
"type": "string"
|
||||
},
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"published_at": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user