Hello, friends.
So far, we have reached an endpoint for getting info for our particular articles from automotive.
In this video, we're going to write our comments and point to use our mobile devices.
But first, we will do a little refracting so we can avoid repetition of code.
So we will create a function call with DB that will look something like this.
So bonds with the be exposed to and this will be a function.
So async and we will pass an argument.
Okay, so that will be operations and inside this.
So this will take care of all the operations.
So now let's copy the code from here.
So let's try and catch block that, copy this and I'll be sticking up for you.
We have to try and catch block.
So we are connecting the Modiba and then we are getting the database and then we are performing some
operations.
And finally we are following Glandore close.
And this is for added handling logic.
We will delete this specific operations.
We are okay.
So let's delete this.
OK, we don't require this and also we want to delete this first line.
OK, let me see this.
Also, we need to pass the second argument response, OK, because we need a response.
OK, so let's save this and then and we will call the operations argument.
So operations and then inside this will pass.
OK, let me save this.
Now this is done.
Now we will be affected and point out, OK, then we will move on to the comments.
OK, so first we will remove everything that is related to database.
So we need to remove this sketch and this one status.
Then we will remove this connection code, OK, and then we will remove this.
Deb, OK, and then we need to remove this necromancy of this and then we need to wrap the entire code
with with DB function.
So I like with DB and inside this, we need a barometer of our DB.
And this is this is going to be an amazing function, so Issing and I get the food and I placed it inside
this function.
Let me save this and you run faster response.
Let's save this and let's start calling for End Point, whether it works or not.
So for that, we need to go to Faustman and this will be a guest list.
OK, so Lauren Slash article slash.
OK.
And if I keep on saying that to be what we are getting in the response, let me check.
The server is running on so control and so controlling back the key.
We are getting some problem.
So let's say what what is that issue to.
We are getting some error.
So you're before this operation.
We need to pass away.
OK.
Let me say this now, this is listening to a thousand.
Now let's take it then a.
Okay, so slash slash article and slash non node.
So if I keep on saying so, I'm getting this data back.
So name the note and comment.
OK, so if I go to learn, react and if I can explain.
So we are getting this idea momentum.
So now let's do this for, let's do the same thing for academics.
OK, so for that we first we need to remove just two lines because this will not work anymore and then
we need to get it to be functional.
So it begins and this will be.
DB and we need to pass, I think so, I think function.
And inside the this, we will write an article in four that is going to be DOT collections and the collection
is articles and we need to find one.
OK.
So find one that is going to be named.
It wants to.
And we will match the name, which is equal to the article name.
OK, so this is going to this through line should be at the top.
So let me get this and I'll start to throw this name is going to going to be equal to article name and
this will be an object function.
So all of it.
And once we find that then we need to wait for DB dot selection and this will be articles.
Then we need to date one and we need to match the name with the name.
So I take the name and then we need to set.
OK, so at the rate twenty dollars set that is going to be common article in the full document and we
need to contact.
So whatever comments we are getting from this seller, we need to contact with the user name and see
this and we need to write a dated article in full, OK.
This is the name of the variable and here we need to wait for a wait and your DB dot election and the
election name is articles and we will find one, so find one.
And we need to find the name which is equal to article name.
OK.
And then finally, we need a response status.
We need to pass two hundred.
OK, Jason updated.
And we need to parse this.
Look, let me say this, and we need to parse the response object, OK, so let's say this and now let's
try it and woodsmen.
So that's who we are.
And you're willing to try to learn more.
So this is going to be a post request.
So first, we need to change this.
Then we need to look at those eight thousand eight slash articles, slash, slash and burn comments
and comments.
And then we need to select a body of law.
And then we do that, Jason, and use that name like as me.
And you can write any text, like user name until you can read anything I wrote me.
And this is what I like.
I love this post.
And let's click on saying so we are getting some edit.
OK, so that is a mistake.
Update one, update one and not update one.
B, let me save this and let's go back to post and let's try it out again.
If I click on Same.
So I am getting the data back.
OK, so we have successfully added this comment in the database.
So this is it for this video and I'll see you in the next video.
OK, bye bye.