remove unecessary logging

This commit is contained in:
Andrzej Stepien 2023-09-10 17:01:21 +02:00
parent 97e8179164
commit 0d66151fae
1 changed files with 2 additions and 0 deletions

View File

@ -49,10 +49,12 @@ export const endpoints = (db) => {
const endpoint = (router,Entity,path,method,db) =>{
router.post(`/${Entity.name.toLowerCase()}/${path}`, async (req,res) => {
try {
logger.trace({data:req.body},"POST request received")
const entity = new Entity(req.body)
await entity[method](db)
res.sendStatus(200)
} catch (error) {
logger.error(error)
if(error instanceof TypeError){
res.sendStatus(400)
}