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 = [
4141 } ) ;
4242
4343 // Check if duplicated key
44- return models . ProductCategory . findById ( req . body . param . key )
44+ return models . ProductCategory . findById ( req . body . param . key , { paranoid : false } )
4545 . then ( ( existing ) => {
4646 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 } " ` ) ;
4848 apiErr . status = 422 ;
4949 return Promise . reject ( apiErr ) ;
5050 }
Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ module.exports = [
4242 } ) ;
4343
4444 // Check if duplicated key
45- return models . ProjectType . findById ( req . body . param . key )
45+ return models . ProjectType . findById ( req . body . param . key , { paranoid : false } )
4646 . then ( ( existing ) => {
4747 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 } " ` ) ;
4949 apiErr . status = 422 ;
5050 return Promise . reject ( apiErr ) ;
5151 }
You can’t perform that action at this time.
0 commit comments