Skip to content

Commit

Permalink
Merge pull request #329 from gets0ul/connect_app_issue-3112
Browse files Browse the repository at this point in the history
Fix for connect-app issue appirio-tech/connect-app#3112
  • Loading branch information
maxceem committed Jul 6, 2019
2 parents 5d31391 + 2f387af commit ef2331d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/routes/productCategories/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ module.exports = [
});

// Check if duplicated key
return models.ProductCategory.findById(req.body.param.key)
return models.ProductCategory.findById(req.body.param.key, { paranoid: false })
.then((existing) => {
if (existing) {
const apiErr = new Error(`Product category already exists for key ${req.params.key}`);
const apiErr = new Error(`Product category already exists(may be deleted) for key "${req.body.param.key}"`);
apiErr.status = 422;
return Promise.reject(apiErr);
}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/projectTypes/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ module.exports = [
});

// Check if duplicated key
return models.ProjectType.findById(req.body.param.key)
return models.ProjectType.findById(req.body.param.key, { paranoid: false })
.then((existing) => {
if (existing) {
const apiErr = new Error(`Project type already exists for key ${req.params.key}`);
const apiErr = new Error(`Project type already exists(may be deleted) for key "${req.body.param.key}"`);
apiErr.status = 422;
return Promise.reject(apiErr);
}
Expand Down

0 comments on commit ef2331d

Please sign in to comment.