{
path: process.env.DOCUMENT + '/{type}/{userid}/{load}',
method: 'POST',
options: {
description: 'To upload candidate document.',
notes: 'Call this api to get the candidate document.' +
'For document uplaod `type` => `D`, photo `type`=> `P` ',
tags: ['api', 'candidate', 'candidateDocument'],
validate: {
params: {
type: Joi.string().required().error(new Error('Please pass appropriate file type.')),
load: Joi.string().required().error(new Error('Please pass appropriate file path.')),
userid: Joi.number().required().error(new Error('Please pass appropriate user id.'))
},
failAction: async (request, h, err) => {
return await CommonFunction.failAction(request, h, err);
}
},
handler: (req, h) => {
console.log(process.env.CANDIDATE_UPLOAD + req.payload.document.replace(/~/g, '/'));
return h.file(process.env.CANDIDATE_UPLOAD + req.payload.document.replace(/~/g, '/'));
},
auth: false
}
},
The component just show the spinner continuuosly and api is also showned as success with status code as 200.
Could you please help us on this.
Regards,
Sinchan