NestJS Blog API - [3] User Entity

preview_player
Показать описание
Time to create a user entity for our data.

------
Links



------
Social Links

Рекомендации по теме
Комментарии
Автор

just a tip for the try/catch in the catch if you check if err has a response object (the throw Unauthorized Exception will add it), then its the unauthorized so you can do like this:

catch (error)
{
if (error.response)
{
throw error;
}
else
{
throw new
}
}
to filter out your own throw :)

problemchild
Автор

I liked this video, many cut the errors part, this is bad, because we don't know how to proceed if it happens to us.
Congratulations, great channel!

nilmendes
Автор

Thanks for the tutorial.
18:20 what will you do if there is more than a unique column, since the thrown error is a database error (MySQL) in my case, the error message contains only the index key as useful information but in the error message.

Also, I would prefer to separate the Auth module into Auth and User modules. so each module is responsible for a single thing, currently the Auth module responsible for getting and creating a user besides the authentication process. they seem to be close in concept but not the same.

ibraheemdev
Автор

also another thing I thought of later, bcryptjs is extremely slow compared to just bcrypt. bcrypt (non js) is a native node module (compiled c++) so it runs much much faster. just an optimization tip the implementation is identical you just get a big performance boost (especially if you build a site that gets a lot of traffic)

problemchild
Автор

also curious what that setup is your using. I stream on twitch (don't do YouTube stuff yet) and its a perfect setup for twitch streaming. like I love how your vs code is in one area and terminal is in another.

problemchild
Автор

for people who are overwhelmed with that typeorm logging, just set logging to false in database connection service.

dpynsnyl
Автор

Mass testing is great for COVID-19 and web development, please consider to make unit and e2e tests

MrKsuhiyp
Автор

oh while I'm at it, another cool tip I learned with typeorm is instead of **/dist/*.entity.ts for the entities, typeorm is smart enough when you use them in Repo injections that you can simply do autoLoadEntities: true and it will auto parse and load them for you :)

problemchild
Автор

hi, I was randomly stumbled upon a developing discord server (the NetsJs one) and I found that you posted your channel link so Imma give you a few likes.

ameenzo
Автор

in dev mode synchronize: false; otherwises you'll get error like this in hot refresh : [Nest] 15308 - 12/16/2021, 11:31:45 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (7)...
QueryFailedError: relation already exists

roussafiomar
Автор

please also include swagger. thank you.

magnifico
join shbcf.ru