Skip to content

Commit 3ba9ef3

Browse files
authored
Merge pull request #519 from xxcxy/fix-issues-511
fix Issue in the email title when the team name has symbols
2 parents 9cefc08 + c0f9689 commit 3ba9ef3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/common/helper.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ async function getProjects (currentUser, criteria = {}) {
10381038
message: `response body: ${JSON.stringify(res.body)}`
10391039
})
10401040
const result = _.map(res.body, (item) => {
1041-
return _.pick(item, ['id', 'name', 'invites', 'members'])
1041+
return _.extend(_.pick(item, ['id', 'invites', 'members']), { name: _.unescape(item.name) })
10421042
})
10431043
return {
10441044
total: Number(_.get(res.headers, 'x-total')),
@@ -1195,7 +1195,7 @@ async function getProjectById (currentUser, id) {
11951195
context: 'getProjectById',
11961196
message: `response body: ${JSON.stringify(res.body)}`
11971197
})
1198-
return _.pick(res.body, ['id', 'name', 'invites', 'members'])
1198+
return _.extend(_.pick(res.body, ['id', 'invites', 'members']), { name: _.unescape(res.body.name) })
11991199
} catch (err) {
12001200
if (err.status === HttpStatus.FORBIDDEN) {
12011201
throw new errors.ForbiddenError(
@@ -1925,7 +1925,8 @@ async function createProject (currentUser, data) {
19251925
context: 'createProject',
19261926
message: `response body: ${JSON.stringify(res)}`
19271927
})
1928-
return _.get(res, 'body')
1928+
const result = _.get(res, 'body')
1929+
return _.extend(result, { name: _.unescape(_.get(result, 'name')) })
19291930
}
19301931

19311932
/**

src/eventHandlers/TeamEventHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function sendNotificationEmail (payload) {
4949
logger.debug({
5050
component: 'TeamEventHandler',
5151
context: 'sendNotificationEmail',
52-
message: `project id: ${payload.project.id} created with jobs: ${_.join(_.map(payload.jobs, 'id'), ',')}`
52+
message: `project id: ${payload.project.id}, subject: ${data.subject}, created with jobs: ${_.join(_.map(payload.jobs, 'id'), ',')}`
5353
})
5454
}
5555

0 commit comments

Comments
 (0)