From the course: Nest.js Developer Lab 2026: Build a Robust API with Authentication, Articles, and User Profiles
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Creating article method - Nest.js Tutorial
From the course: Nest.js Developer Lab 2026: Build a Robust API with Authentication, Articles, and User Profiles
Creating article method
In this video, we will fully create createArticle method, and actually it will be super similar to our method of create that we used for registration of the user. So we need a method inside controller, we need a service method that will do insertion inside our database, and of course we need our DTO to have a payload of creating an article. So here I will jump inside source, article, controller, and here is our create method. But we have here something interesting. Actually if we will check the specification, you can see that for create article authentication is required. So actually this means that we will have here user ID, and without this user ID we can't really create an article. Because article must belong to one user. actually brings us to the topic of relations. Why relations? Because we have now relations between tables. First of all we have the table of the users where we have for example an ID and a name of the user and we have a table with the article. So when we are…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Creating article module13m 5s
-
(Locked)
Creating article method18m 55s
-
(Locked)
Polishing create article8m 41s
-
(Locked)
Get article by slug6m 26s
-
(Locked)
Deleting the article11m 5s
-
(Locked)
Updating an article11m 12s
-
(Locked)
Creating feed25m 28s
-
(Locked)
Liking articles17m 38s
-
(Locked)
Disliking articles20m 28s
-
(Locked)
-
-
-