mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 10:56:53 -05:00
Trying to handle when earned achievements aren't created via POST.
This commit is contained in:
parent
e576557bba
commit
35726bf41c
1 changed files with 5 additions and 1 deletions
|
@ -93,7 +93,11 @@ class EarnedAchievementHandler extends Handler
|
|||
)
|
||||
else
|
||||
EarnedAchievement.createForAchievement(achievement, trigger, null, null, (earnedAchievementDoc) =>
|
||||
@sendCreated(res, earnedAchievementDoc.toObject())
|
||||
if earnedAchievementDoc
|
||||
@sendCreated(res, earnedAchievementDoc.toObject())
|
||||
else
|
||||
console.error "Couldn't create achievement", achievement, trigger
|
||||
@sendNotFoundError res, "Couldn't create achievement"
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue