Skip to content

Commit 3917931

Browse files
author
Parth Shah
committed
fixing search query with deleted projects, making direct project creation optional
1 parent 1b9185a commit 3917931

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/models/projectMember.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = function(sequelize, DataTypes) {
4242
raw: true
4343
})
4444
.then((res) => {
45-
return _.map(res, 'projectId')
45+
return _.without(_.map(res, 'projectId'), null)
4646
})
4747
},
4848
getActiveProjectMembers: function(projectId) {

src/routes/attachments/create.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ module.exports = [
3737
* Add project attachment
3838
*/
3939
(req, res, next) => {
40-
console.log('here1')
4140
var data = req.body.param
4241
// default values
4342
var projectId = req.params.projectId

src/routes/projectMembers/update.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ module.exports = [
5656
_.assign(projectMember, updatedProps)
5757
newValue = projectMember.get({plain: true})
5858

59-
console.log('Prev Value:', previousValue)
60-
console.log('New Value:', newValue)
6159
// no updates if no change
6260
if(updatedProps.role === previousValue.role &&
6361
(_.isUndefined(updatedProps.isPrimary) || updatedProps.isPrimary === previousValue.isPrimary)) {

src/routes/projects/create.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,18 @@ module.exports = [
111111
body.billingAccountId = newProject.billingAccountId
112112
}
113113
return directProject.createDirectProject(req, body)
114-
})
115-
.then((resp) => {
116-
newProject.directProjectId = resp.data.result.content.projectId
117-
return newProject.save()
118-
})
119-
.then(() => {
120-
return newProject.reload(newProject.id)
114+
.then((resp) => {
115+
newProject.directProjectId = resp.data.result.content.projectId
116+
return newProject.save()
117+
})
118+
.then(() => {
119+
return newProject.reload(newProject.id)
120+
})
121+
.catch(err => {
122+
// log the error and continue
123+
req.log.error('Error creating direct project')
124+
req.log.error(err)
125+
})
121126
})
122127
.then(() => {
123128
newProject = newProject.get({plain: true})

0 commit comments

Comments
 (0)