Skip to content

Commit 64fe5f1

Browse files
Fix sanitizeChallenge
1 parent de8d006 commit 64fe5f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/services/ChallengeService.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,6 @@ function sanitizeChallenge (challenge) {
16221622
'startDate',
16231623
'status',
16241624
'task',
1625-
'attachments',
16261625
'groups'
16271626
])
16281627
if (!_.isUndefined(sanitized.name)) {
@@ -1668,6 +1667,9 @@ function sanitizeChallenge (challenge) {
16681667
if (challenge.terms) {
16691668
sanitized.terms = _.map(challenge.terms, term => _.pick(term, ['id', 'roleId']))
16701669
}
1670+
if (challenge.attachments) {
1671+
sanitized.attachments = _.map(challenge.attachments, attachment => _.pick(attachment, ['id', 'name', 'url', 'fileSize', 'description']))
1672+
}
16711673
return sanitized
16721674
}
16731675

0 commit comments

Comments
 (0)