fix: do not error when generating slug if not track title is present
This commit is contained in:
parent
7fec413437
commit
af1e186069
|
@ -59,7 +59,7 @@ schema.pre('validate', async function (next) {
|
|||
|
||||
class Track extends mongoose.Model {
|
||||
slugify() {
|
||||
this.slug = slug(this.title) + '-' + ((Math.random() * Math.pow(36, 6)) | 0).toString(36);
|
||||
this.slug = slug(this.title || 'track') + '-' + ((Math.random() * Math.pow(36, 6)) | 0).toString(36);
|
||||
}
|
||||
|
||||
async generateOriginalFilePath() {
|
||||
|
|
Loading…
Reference in a new issue