1
00:00:07,730 --> 00:00:08,780
In this video.

2
00:00:08,780 --> 00:00:16,010
Let's see how we can update an account and I can give this one to you as a challenge, because we have

3
00:00:16,010 --> 00:00:20,450
done the same concept when we are dealing with the user updating.

4
00:00:20,450 --> 00:00:23,540
So you can post this video and give it a shot.

5
00:00:36,040 --> 00:00:40,230
So inside the account and here is accounts.

6
00:00:40,240 --> 00:00:43,000
Let's collapse the one that we are done.

7
00:00:43,000 --> 00:00:45,500
So here is the update.

8
00:00:45,520 --> 00:00:47,350
Well, this one good.

9
00:00:47,680 --> 00:00:54,250
So for this one, we are going to find it by ID and can get the ID from the params.

10
00:00:54,250 --> 00:00:59,620
So here we go as we did for the fetch and single account.

11
00:00:59,630 --> 00:01:01,330
Going to be the same thing here.

12
00:01:01,360 --> 00:01:07,660
So I'll grab the ID from the red dot params and here we go.

13
00:01:07,720 --> 00:01:13,990
So Congs are going to find the account which is equal to our weight.

14
00:01:14,560 --> 00:01:19,990
And then you bring in the account dot fine by id and ab date.

15
00:01:19,990 --> 00:01:26,980
And the id is this one and the properties that I want added, i want to update the entire field.

16
00:01:27,250 --> 00:01:34,900
Is that the other element is going to be the optional configuration here provide new to true and then

17
00:01:34,900 --> 00:01:40,240
the run validators also to true and that is it.

18
00:01:40,270 --> 00:01:42,150
We are done with the updating.

19
00:01:42,160 --> 00:01:45,010
So here I forgot to use our error here.

20
00:01:45,010 --> 00:01:51,010
So let's call next and we pass in our error as an error.

21
00:01:51,010 --> 00:02:00,580
Then that's the first argument going to be the error dot message and then you pass in 500 and here you

22
00:02:00,580 --> 00:02:06,340
need to pass it next and that great is next.

23
00:02:07,270 --> 00:02:11,650
And for the single to our paste this one here and that is it.

24
00:02:11,650 --> 00:02:15,650
So let's get back to our updating and here we go.

25
00:02:15,670 --> 00:02:19,000
So our call, our error here and that.

26
00:02:19,120 --> 00:02:24,580
And lastly, let's send the response status, which is success.

27
00:02:26,520 --> 00:02:31,020
And then the data as a count.

28
00:02:31,650 --> 00:02:32,400
All right.

29
00:02:32,400 --> 00:02:34,320
So moment of truth.

30
00:02:34,530 --> 00:02:38,950
So back here inside the ten declines.

31
00:02:39,060 --> 00:02:43,050
Let's locate the account for updating, which is this one.

32
00:02:43,290 --> 00:02:46,500
So this time around, I want to find a single account.

33
00:02:46,500 --> 00:02:51,660
So I need to update the last one, which is education.

34
00:02:51,660 --> 00:02:53,700
So our copy this one.

35
00:02:53,700 --> 00:03:00,000
And for the update here, I'll provide the right ID and then for the payload.

36
00:03:00,540 --> 00:03:03,990
Let's say I want to change the name.

37
00:03:05,340 --> 00:03:11,970
To let us see personal predict and let me hit send.

38
00:03:12,810 --> 00:03:13,370
Sorry.

39
00:03:13,380 --> 00:03:15,150
The problem is about my parts.

40
00:03:15,150 --> 00:03:17,030
I change mine to 8080.

41
00:03:17,040 --> 00:03:18,300
So let's see.

42
00:03:18,720 --> 00:03:25,920
You can see that I've changed the account name to personal and I can change the initial balance also.

43
00:03:25,920 --> 00:03:35,280
So here I will provide the initial balance and I would say for this one RS 5000 and I'll hit send and

44
00:03:35,280 --> 00:03:38,520
you can see that indeed it has been updated.

