@@ -500,7 +500,7 @@ async function searchChallenges (currentUser, criteria) {
500
500
}
501
501
}
502
502
503
- // logger.debug(`es Query ${JSON.stringify(esQuery)}`)
503
+ logger . debug ( `es Query ${ JSON . stringify ( esQuery ) } ` )
504
504
505
505
// Search with constructed query
506
506
let docs
@@ -1160,6 +1160,7 @@ async function update (currentUser, challengeId, data, userToken, isFull) {
1160
1160
// helper.ensureNoDuplicateOrNullElements(data.gitRepoURLs, 'gitRepoURLs')
1161
1161
1162
1162
const challenge = await helper . getById ( 'Challenge' , challengeId )
1163
+ logger . debug ( `Dynamo Object before update: ${ JSON . stringify ( challenge ) } ` )
1163
1164
// FIXME: Tech Debt
1164
1165
let billingAccountId
1165
1166
if ( data . status ) {
@@ -1521,7 +1522,9 @@ async function update (currentUser, challengeId, data, userToken, isFull) {
1521
1522
}
1522
1523
}
1523
1524
1524
- // logger.debug(`Challenge.update id: ${challengeId} Details: ${JSON.stringify(updateDetails)}`)
1525
+ logger . debug ( `Challenge.update id: ${ challengeId } Details: ${ JSON . stringify ( updateDetails ) } ` )
1526
+ logger . debug ( `Dynamo Object before writing to dynamo: ${ JSON . stringify ( challenge ) } ` )
1527
+ logger . debug ( `Dynamo update operations: ${ JSON . stringify ( updateDetails ) } ` )
1525
1528
await models . Challenge . update ( { id : challengeId } , updateDetails )
1526
1529
1527
1530
if ( auditLogs . length > 0 ) {
@@ -1530,14 +1533,6 @@ async function update (currentUser, challengeId, data, userToken, isFull) {
1530
1533
1531
1534
delete data . attachmentIds
1532
1535
delete data . terms
1533
- if ( data . phases ) {
1534
- _ . each ( data . phases , p => {
1535
- delete p . name
1536
- if ( p . description ) {
1537
- delete p . description
1538
- }
1539
- } )
1540
- }
1541
1536
_ . assign ( challenge , data )
1542
1537
if ( ! _ . isUndefined ( newAttachments ) ) {
1543
1538
challenge . attachments = newAttachments
@@ -1575,6 +1570,7 @@ async function update (currentUser, challengeId, data, userToken, isFull) {
1575
1570
if ( billingAccountId ) {
1576
1571
busEventPayload . billingAccountId = billingAccountId
1577
1572
}
1573
+ logger . debug ( `ES Object before posting to bus: ${ JSON . stringify ( busEventPayload ) } ` )
1578
1574
await helper . postBusEvent ( constants . Topics . ChallengeUpdated , busEventPayload )
1579
1575
1580
1576
if ( challenge . phases && challenge . phases . length > 0 ) {
@@ -1819,7 +1815,7 @@ partiallyUpdateChallenge.schema = {
1819
1815
type : Joi . string ( ) . required ( ) ,
1820
1816
value : Joi . number ( ) . min ( 0 ) . required ( )
1821
1817
} ) ) . min ( 1 ) . required ( )
1822
- } ) . unknown ( true ) ) ,
1818
+ } ) . unknown ( true ) ) . min ( 1 ) ,
1823
1819
tags : Joi . array ( ) . items ( Joi . string ( ) . required ( ) ) . min ( 1 ) , // tag names
1824
1820
projectId : Joi . number ( ) . integer ( ) . positive ( ) ,
1825
1821
legacyId : Joi . number ( ) . integer ( ) . positive ( ) ,
0 commit comments