File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ module.exports = [
41
41
} ) ;
42
42
43
43
// Check if duplicated key
44
- return models . ProductCategory . findById ( req . body . param . key )
44
+ return models . ProductCategory . findById ( req . body . param . key , { paranoid : false } )
45
45
. then ( ( existing ) => {
46
46
if ( existing ) {
47
- const apiErr = new Error ( `Product category already exists for key ${ req . params . key } ` ) ;
47
+ const apiErr = new Error ( `Product category already exists(may be deleted) for key " ${ req . body . param . key } " ` ) ;
48
48
apiErr . status = 422 ;
49
49
return Promise . reject ( apiErr ) ;
50
50
}
Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ module.exports = [
42
42
} ) ;
43
43
44
44
// Check if duplicated key
45
- return models . ProjectType . findById ( req . body . param . key )
45
+ return models . ProjectType . findById ( req . body . param . key , { paranoid : false } )
46
46
. then ( ( existing ) => {
47
47
if ( existing ) {
48
- const apiErr = new Error ( `Project type already exists for key ${ req . params . key } ` ) ;
48
+ const apiErr = new Error ( `Project type already exists(may be deleted) for key " ${ req . body . param . key } " ` ) ;
49
49
apiErr . status = 422 ;
50
50
return Promise . reject ( apiErr ) ;
51
51
}
You can’t perform that action at this time.
0 commit comments