-
-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
help wantedExtra attention is neededExtra attention is needed

Description
I read documentation about async handlers and hooks and that done
must not be called in case of an async function.
💬 Question here
I'm having multiple calls on this request
fastify.post('/donations', postSectionHandler)
// postSectionHandler being either
return async (req, reply, done) => {
console.log("*************CALLED TWICE***********")
const { body } = req
const { error } = validationPipeLine(req)
if (!isEmpty(error)) {
reply.send({ message: 'Invalid request' })
} else {
// Files other than images are undefined
if (!req.file) {
reply.send({
message: 'Invalid request',
data: body,
error: 'file not found'
})
}
let acknowledged = await insertDocument(QInstance, req, reply, null, false)
// done()
}
}
Thanks in advance !
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed