In this video.
Let's see how we can update an account and I can give this one to you as a challenge, because we have
done the same concept when we are dealing with the user updating.
So you can post this video and give it a shot.
So inside the account and here is accounts.
Let's collapse the one that we are done.
So here is the update.
Well, this one good.
So for this one, we are going to find it by ID and can get the ID from the params.
So here we go as we did for the fetch and single account.
Going to be the same thing here.
So I'll grab the ID from the red dot params and here we go.
So Congs are going to find the account which is equal to our weight.
And then you bring in the account dot fine by id and ab date.
And the id is this one and the properties that I want added, i want to update the entire field.
Is that the other element is going to be the optional configuration here provide new to true and then
the run validators also to true and that is it.
We are done with the updating.
So here I forgot to use our error here.
So let's call next and we pass in our error as an error.
Then that's the first argument going to be the error dot message and then you pass in 500 and here you
need to pass it next and that great is next.
And for the single to our paste this one here and that is it.
So let's get back to our updating and here we go.
So our call, our error here and that.
And lastly, let's send the response status, which is success.
And then the data as a count.
All right.
So moment of truth.
So back here inside the ten declines.
Let's locate the account for updating, which is this one.
So this time around, I want to find a single account.
So I need to update the last one, which is education.
So our copy this one.
And for the update here, I'll provide the right ID and then for the payload.
Let's say I want to change the name.
To let us see personal predict and let me hit send.
Sorry.
The problem is about my parts.
I change mine to 8080.
So let's see.
You can see that I've changed the account name to personal and I can change the initial balance also.
So here I will provide the initial balance and I would say for this one RS 5000 and I'll hit send and
you can see that indeed it has been updated.