Great video! There was one problem that I faced that no video, not even this one addressed. When sending over the file data to the smtp client, in my case I had to send the result from the fileReader.onload(event) call. The event object has the target which has the .result property. This property contains the blob (file data) that I needed to send to the back-end. Trying to send e.target.files[0] only sent the string, "c://fakePath/name-of-file.jpg" and not the actual blob data. So within the fileReader.onload(event) function, you can get the result of the file data like so and then set it as the value of the form field to be sent to the back end: event.target?.result In react-hook-form I set the field value of the "file" field as follows: "setValue('file', { fileName, blob: event.target?.result?.toString() || '', });" This was the ONLY way that it worked for me.
guys, I will make a video on Swagger which is easier than this tutorial. all these RU-vidr follows the same method to write the swagger documentation but I have the easiest way where a noob can understand the swagger implementation.
Thanx man, trying to delete the bad commit is very confusing and difficult. I was thinking on doing it this way, you just confirmed my theory, thank you!
I like the approach, however, It has some pretty bad errors in it in the beginning. rm <file name> -r, in Setting the default editor, you get to work on a repository that is not there: configuring-git-00. The needs an errata link somewhere, I did not see one listed on Amazon where I bought the book.
No way i'm documenting my API like that. There is more comment then code in that shit. You can document an endpoint .NET using Swagger with 5 lines of code
Misleading. You did not "Extract" the type of the interface fields to print out type "x" is number, type "y" is string. That is what "Extract" means. Not just show it on TS syntax check highlights.
I made an auth context that used custom hooks to do things like get the current user, find out whether the user is signed in, whether the user is an admin, and manage a session. I then tried to mock the custom hooks for my auth context tests -- but that proved too complex for me. Ultimately I ended up mocking the underlying APIs used by the custom hooks. It worked but the whole thing doesn't *feel* right. I do have separate tests for the individual custom hooks. I'd really like some help with that kind of scenario.
Good information. And how to use one event handler for multiple event types if I dont want to duplicate code in seperate event handlers but implement a generic handler?