Skip to content

Commit 649699e

Browse files
author
Vikas Agarwal
committed
fix: git#843-Unable to add prizes for a challenge in New status
1 parent 6471eaa commit 649699e

File tree

1 file changed

+2
-1
lines changed
  • src/components/ChallengeEditor/ChallengePrizes-Field

1 file changed

+2
-1
lines changed

src/components/ChallengeEditor/ChallengePrizes-Field/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ class ChallengePrizesField extends Component {
4848
onUpdateValue (challengePrize) {
4949
const type = PRIZE_SETS_TYPE.CHALLENGE_PRIZES
5050
const { onUpdateOthers, challenge } = this.props
51+
const existingPrizes = challenge.prizeSets ? challenge.prizeSets.filter(p => p.type !== type) : []
5152

52-
onUpdateOthers({ field: 'prizeSets', value: [...challenge.prizeSets.filter(p => p.type !== type), challengePrize] })
53+
onUpdateOthers({ field: 'prizeSets', value: [...existingPrizes, challengePrize] })
5354
}
5455

5556
getChallengePrize () {

0 commit comments

Comments
 (0)