Skip to content

Commit e9cb750

Browse files
authored
repo sync
2 parents 46eaac2 + f5bac33 commit e9cb750

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

middleware/events.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function airtablePost (req, res, next) {
3535
return res.status(201).send({ id: records[0].getId() })
3636
} catch (err) {
3737
console.error('unable to POST event', err)
38-
return res.status(err.statusCode).send(err)
38+
return res.status(502).send({})
3939
}
4040
}
4141

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

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

0 commit comments

Comments
 (0)