remove unecessary logging
This commit is contained in:
parent
97e8179164
commit
0d66151fae
|
@ -49,10 +49,12 @@ export const endpoints = (db) => {
|
||||||
const endpoint = (router,Entity,path,method,db) =>{
|
const endpoint = (router,Entity,path,method,db) =>{
|
||||||
router.post(`/${Entity.name.toLowerCase()}/${path}`, async (req,res) => {
|
router.post(`/${Entity.name.toLowerCase()}/${path}`, async (req,res) => {
|
||||||
try {
|
try {
|
||||||
|
logger.trace({data:req.body},"POST request received")
|
||||||
const entity = new Entity(req.body)
|
const entity = new Entity(req.body)
|
||||||
await entity[method](db)
|
await entity[method](db)
|
||||||
res.sendStatus(200)
|
res.sendStatus(200)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
logger.error(error)
|
||||||
if(error instanceof TypeError){
|
if(error instanceof TypeError){
|
||||||
res.sendStatus(400)
|
res.sendStatus(400)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue