mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Don't let a discussion have an empty slug as it messes with the router
This commit is contained in:
parent
d7667fdea6
commit
25f399ca35
|
@ -18,7 +18,7 @@ class Discussion extends Model {
|
||||||
|
|
||||||
Discussion.prototype.id = Model.prop('id');
|
Discussion.prototype.id = Model.prop('id');
|
||||||
Discussion.prototype.title = Model.prop('title');
|
Discussion.prototype.title = Model.prop('title');
|
||||||
Discussion.prototype.slug = computed('title', title => title.toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-').replace(/-$|^-/g, ''));
|
Discussion.prototype.slug = computed('title', title => title.toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-').replace(/-$|^-/g, '') || '-');
|
||||||
|
|
||||||
Discussion.prototype.startTime = Model.prop('startTime', Model.date);
|
Discussion.prototype.startTime = Model.prop('startTime', Model.date);
|
||||||
Discussion.prototype.startUser = Model.one('startUser');
|
Discussion.prototype.startUser = Model.one('startUser');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user