fix: do not error when generating slug if not track title is present
This commit is contained in:
parent
7fec413437
commit
af1e186069
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ schema.pre('validate', async function (next) {
|
||||||
|
|
||||||
class Track extends mongoose.Model {
|
class Track extends mongoose.Model {
|
||||||
slugify() {
|
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() {
|
async generateOriginalFilePath() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue