I ask this question because I have a problem when it comes to receiving some data in a promise.
return res.status(200).send({message: 'Se ha subido el archivo de video satisfactoriamente.', video: updatedVideo, file_name: file_name});
That's what the video controller returns, made in NodeJs.
(result) => {
console.log(result);
this.video.setFile(result.file_name);
alert('Se ha actualizado el video del registro.');
},
and this is the part of TypeScript in which I receive the name of the file. But when I'm going to run the application it tells me this error:
TS2339 error: Property 'file_name' does not exist on type '{}'.
The fact is that once I have run it, commenting on the phrases that caused the error, and causing it to appear in the console "result" I receive perfectly file_name, etc. Anyone who can help me receive that: "file_name" correctly? Thanks in advance.