I ask this question because I have a problem when 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 where I get the name of the file. But when I go to run the application it gives me this error:
error TS2339: Property 'file_name' does not exist on type '{}'.
The fact is that once I have managed to execute it by commenting out the sentences that caused the error, and making it appear in the "result" console, I perfectly receive file_name, etc. Can someone give me a hand to receive that: "file_name" correctly? Thanks in advance.
I managed to access the value I needed like this:
Thank you very much aldanux for your attention.