I have a controller with two functions:
module.exports.getQuestionnaire = function(application, req, res) {
}
module.exports.getClientDetails = function(application, req, res) {
}
I want to call the getQuestionnaire function inside the getClientDetails function.
Just calling getQuestionnaire() does not work. How should I do this?
Advertisement
Answer
What I usually do:
const getQuestionnaire = () => {
//getClientDetails()
}
const getClientDetails = () => {
//getQuestionnaire()
}
module.exports = {getQuestionnaire, getClientDetails}