File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ const slug = require('slug');
3
3
const getUniqueSlug = require ( '../helper/get-unique-slug' ) ;
4
4
const _ = require ( 'lodash' ) ;
5
5
6
- module . exports = function ( options = { field : null } ) {
6
+ module . exports = function ( options = { field : null , overwrite : false } ) {
7
7
return function ( hook ) {
8
8
if ( ! options . field || ! hook . data [ options . field ] ) return hook ;
9
9
10
10
// do not overwrite existing slug
11
- // TODO: we should make that possible and relying on ids for routing insead only on slugs
11
+ // TODO: we should make that possible and relying on ids for routing instead 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 ) && ( ! options . overwrite && options . overwrite === false ) ) return hook ;
13
+ if ( ! _ . isEmpty ( hook . data . slug ) && options . overwrite !== false ) return hook ;
14
14
15
15
return new Promise ( resolve => {
16
16
You can’t perform that action at this time.
0 commit comments