System Information
- Strapi 4.1.0:
- Macos 12.2:
- MySQL 8.0.28:
- Node v14.17.0:
- NPM v8.3.0:
- Yarn v1.22.17:
I’m trying to use the basic slugify code to auto-create a slug (I’m not using a UUID because I want to have a shared slug value or all locales).
In ./src/api/post/content-types/post/lifecycles.js, I have the following code:
const slugify = require("slugify");
module.exports = {
beforeCreate(event) {
const { data } = event.params;
console.log('hi before')
if (data.title) {
data.slug = slugify(data.title, { lower: true });
}
},
beforeUpdate(event) {
const { data } = event.params;
console.log('hi before')
if (data.title) {
data.slug = slugify(data.title, { lower: true });
}
},
};
Nothing fires when I interact with the post fields in the Content Manager. Has anyone else run into this in v4?