File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ module.exports = function (options = { field: null }) {
10
10
// do not overwrite existing slug
11
11
// TODO: we should make that possible and relying on ids for routing insead only on slugs
12
12
// the slug should be there for seo reasons but the id should be what counts
13
- if ( ! _ . isEmpty ( hook . data . slug ) ) return hook ;
13
+ if ( ! _ . isEmpty ( hook . data . slug ) && ( ! options . overwrite && options . overwrite === false ) ) return hook ;
14
14
15
15
return new Promise ( resolve => {
16
16
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ module.exports = {
55
55
excludeDisabled ( ) ,
56
56
restrictToOwner ( )
57
57
) ,
58
- createSlug ( { field : 'name' } ) ,
58
+ createSlug ( { field : 'name' , overwrite : true } ) ,
59
59
createExcerpt ( { field : 'description ' } ) ,
60
60
saveRemoteImages ( [ 'logo' , 'coverImg' ] )
61
61
] ,
@@ -68,7 +68,7 @@ module.exports = {
68
68
excludeDisabled ( ) ,
69
69
restrictToOwner ( )
70
70
) ,
71
- createSlug ( { field : 'name' } ) ,
71
+ createSlug ( { field : 'name' , overwrite : true } ) ,
72
72
createExcerpt ( { field : 'description' } ) ,
73
73
saveRemoteImages ( [ 'logo' , 'coverImg' ] )
74
74
] ,
You can’t perform that action at this time.
0 commit comments