Add slug to awtis
This commit is contained in:
@@ -735,6 +735,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"published_at": {
|
"published_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
@@ -771,6 +774,9 @@
|
|||||||
"user": {
|
"user": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"published_at": {
|
"published_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ const jwennAwtisEpiId = async id => {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
lifecycles: {
|
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) => {
|
afterUpdate: async (params, data) => {
|
||||||
const {id} = data
|
const {id} = data
|
||||||
const awtis = await jwennAwtisEpiId(id)
|
const awtis = await jwennAwtisEpiId(id)
|
||||||
|
|||||||
@@ -45,6 +45,9 @@
|
|||||||
"user": {
|
"user": {
|
||||||
"plugin": "users-permissions",
|
"plugin": "users-permissions",
|
||||||
"model": "user"
|
"model": "user"
|
||||||
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -631,6 +631,9 @@
|
|||||||
"user": {
|
"user": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"published_at": {
|
"published_at": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
"component": "url.liens"
|
"component": "url.liens"
|
||||||
},
|
},
|
||||||
"awtis": {
|
"awtis": {
|
||||||
"collection": "awtis",
|
|
||||||
"via": "teks",
|
"via": "teks",
|
||||||
|
"collection": "awtis",
|
||||||
"dominant": true
|
"dominant": true
|
||||||
},
|
},
|
||||||
"kouteyAchtey": {
|
"kouteyAchtey": {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"url": "https://o-k-i.net"
|
"url": "https://o-k-i.net"
|
||||||
},
|
},
|
||||||
"license": null,
|
"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": {
|
"x-strapi-config": {
|
||||||
"path": "/dokiman",
|
"path": "/dokiman",
|
||||||
@@ -1580,6 +1580,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"published_at": {
|
"published_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
@@ -1616,6 +1619,9 @@
|
|||||||
"user": {
|
"user": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"published_at": {
|
"published_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
@@ -1922,6 +1928,9 @@
|
|||||||
"user": {
|
"user": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"published_at": {
|
"published_at": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user