allow purchasing potion on API

This commit is contained in:
Tyler Renelle
2013-08-25 20:39:54 -04:00
parent f37c7b434a
commit 4841c4d54e
+2 -2
View File
@@ -220,8 +220,8 @@ api.sortTask = (req, res, next) ->
api.buy = (req, res, next) ->
{user} = res.locals
type = req.params.type
unless type in ['weapon', 'armor', 'head', 'shield']
return res.json(400, err: ":type must be in one of: 'weapon', 'armor', 'head', 'shield'")
unless type in ['weapon', 'armor', 'head', 'shield', 'potion']
return res.json(400, err: ":type must be in one of: 'weapon', 'armor', 'head', 'shield', 'potion'")
hasEnough = items.buyItem(user, type)
if hasEnough
user.save (err, saved) ->