mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 23:57:32 +00:00
Update slug.md (#8554)
The lack of if statement generates runtime errors when following this guide. Signed-off-by: Walsker <walsker@walwal.me>
This commit is contained in:
parent
7ab05639ed
commit
dc6c513290
@ -70,7 +70,9 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
beforeUpdate: async (params, data) => {
|
||||
data.slug = slugify(data.title);
|
||||
if (data.title) {
|
||||
data.slug = slugify(data.title);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user