Challenge Won Notification improvements (#12762)

* challenge won notification: add more info

* update tests

* use new notification on web, fixes #7716

* wip design

* finalize design

* fix markdown rendering
This commit is contained in:
Matteo Pagliazzi
2020-11-10 18:47:13 +01:00
committed by GitHub
parent 4319bd5ad1
commit 181b33101e
19 changed files with 261 additions and 124 deletions

View File

@@ -379,7 +379,12 @@ schema.methods.closeChal = async function closeChal (broken = {}) {
winner.balance += challenge.prize / 4;
}
winner.addNotification('WON_CHALLENGE');
winner.addNotification('WON_CHALLENGE', {
id: challenge._id,
name: challenge.name,
prize: challenge.prize,
leader: challenge.leader,
});
const savedWinner = await winner.save();