Return when no appId

This commit is contained in:
Pablo Carranza Vélez 2015-07-24 18:03:37 -03:00
parent 397fd6872b
commit 1e340f4fac

View File

@ -31,7 +31,7 @@ module.exports = (secret) ->
appId = req.body.appId
utils.mixpanelTrack('Spawn tty', appId)
if !appId?
res.status(400).send('Missing app id')
return res.status(400).send('Missing app id')
knex('app').select().where({appId})
.then ([ app ]) ->
if !app?
@ -46,7 +46,7 @@ module.exports = (secret) ->
appId = req.body.appId
utils.mixpanelTrack('Despawn tty', appId)
if !appId?
res.status(400).send('Missing app id')
return res.status(400).send('Missing app id')
knex('app').select().where({appId})
.then ([ app ]) ->
if !app?