Skip to content

Commit

Permalink
repo sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Octomerger authored Oct 9, 2020
2 parents 46eaac2 + f5bac33 commit e9cb750
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function airtablePost (req, res, next) {
return res.status(201).send({ id: records[0].getId() })
} catch (err) {
console.error('unable to POST event', err)
return res.status(err.statusCode).send(err)
return res.status(502).send({})
}
}

Expand All @@ -52,11 +52,11 @@ router.post('/', async (req, res, next) => {
const fields = omit(req.body, OMIT_FIELDS)
try {
const hydroRes = await req.hydro.publish(req.hydro.schemas[req.body.type], fields)
if (!hydroRes.ok) return res.status(500).json({})
if (!hydroRes.ok) return res.status(502).json({})
return res.status(201).json(fields)
} catch (err) {
if (process.env.NODE_ENV === 'development') console.log(err)
return res.status(500).json({})
return res.status(502).json({})
}
})

Expand All @@ -82,7 +82,7 @@ router.put('/:id', async (req, res, next) => {
return res.status(200).send({})
} catch (err) {
console.error('unable to PUT event', err)
return res.status(err.statusCode).send(err)
return res.status(502).send({})
}
})

Expand Down

0 comments on commit e9cb750

Please sign in to comment.