@@ -1668,7 +1668,7 @@ function sanitizeChallenge (challenge) {
1668
1668
sanitized . terms = _ . map ( challenge . terms , term => _ . pick ( term , [ 'id' , 'roleId' ] ) )
1669
1669
}
1670
1670
if ( challenge . attachments ) {
1671
- sanitized . attachments = _ . map ( challenge . attachments , attachment => _ . pick ( attachment , [ 'id' , 'name' , 'url' , 'fileSize' , 'description' ] ) )
1671
+ sanitized . attachments = _ . map ( challenge . attachments , attachment => _ . pick ( attachment , [ 'id' , 'name' , 'url' , 'fileSize' , 'description' , 'challengeId' ] ) )
1672
1672
}
1673
1673
return sanitized
1674
1674
}
@@ -1746,6 +1746,8 @@ fullyUpdateChallenge.schema = {
1746
1746
startDate : Joi . date ( ) ,
1747
1747
status : Joi . string ( ) . valid ( _ . values ( constants . challengeStatuses ) ) . required ( ) ,
1748
1748
attachments : Joi . array ( ) . items ( Joi . object ( ) . keys ( {
1749
+ id : Joi . id ( ) ,
1750
+ challengeId : Joi . id ( ) ,
1749
1751
name : Joi . string ( ) . required ( ) ,
1750
1752
url : Joi . string ( ) . uri ( ) . required ( ) ,
1751
1753
fileSize : Joi . fileSize ( ) ,
@@ -1840,6 +1842,8 @@ partiallyUpdateChallenge.schema = {
1840
1842
legacyId : Joi . number ( ) . integer ( ) . positive ( ) ,
1841
1843
status : Joi . string ( ) . valid ( _ . values ( constants . challengeStatuses ) ) ,
1842
1844
attachments : Joi . array ( ) . items ( Joi . object ( ) . keys ( {
1845
+ id : Joi . id ( ) ,
1846
+ challengeId : Joi . id ( ) ,
1843
1847
name : Joi . string ( ) . required ( ) ,
1844
1848
url : Joi . string ( ) . uri ( ) . required ( ) ,
1845
1849
fileSize : Joi . fileSize ( ) ,
0 commit comments