1
00:00:06,430 --> 00:00:07,660
Welcome back.

2
00:00:07,689 --> 00:00:11,080
In this video, let's work with the transaction.

3
00:00:11,320 --> 00:00:16,820
So going to be the same format so you can put this video and then give yourself a challenge.

4
00:00:16,840 --> 00:00:24,220
So what we have done is about creating the risk that is fetching or getting a single transaction delete

5
00:00:24,220 --> 00:00:24,850
update.

6
00:00:24,850 --> 00:00:26,470
We haven't implement that.

7
00:00:26,470 --> 00:00:29,350
So let's go ahead and then do the Hawaiian.

8
00:00:29,350 --> 00:00:36,220
So I think for this one, we can implement them at a go because it's follow the same concept.

9
00:00:36,220 --> 00:00:39,730
So for fetching or it's pretty simple as this.

10
00:00:39,730 --> 00:00:49,690
So here we bring in cons and then I'll pass this one as transaction trans for pure and then I wait and

11
00:00:49,690 --> 00:00:55,090
then the transaction model dot find and as that I'm done.

12
00:00:55,090 --> 00:01:07,690
So lastly, I need to say status code as 200 and then adjacent data as this status to be success success

13
00:01:07,690 --> 00:01:12,940
and then the data as transactions.

14
00:01:13,990 --> 00:01:20,830
The next one going to be the single so I can collapse this one and for the single two I need the ID.

15
00:01:20,830 --> 00:01:25,600
So here cost less the structure, the id.

16
00:01:25,600 --> 00:01:30,580
So read the params and here we have the ID.

17
00:01:30,580 --> 00:01:39,280
So next step is that we are going to find the transaction by ID is equal to weight and then the transaction

18
00:01:39,280 --> 00:01:43,750
model dot by ID and I'll pass in the ID.

19
00:01:43,780 --> 00:01:46,450
So lastly, I need to send the response.

20
00:01:46,450 --> 00:01:49,390
So I forgot to turn some error here.

21
00:01:49,780 --> 00:01:53,140
So let's do it quickly here as next.

22
00:01:53,140 --> 00:01:56,470
So let's pass it next to this one.

23
00:01:57,220 --> 00:02:04,450
And down here we call next and then we call the instance of our up error.

24
00:02:08,669 --> 00:02:13,980
And then they start as cold as 500 minute internal server error.

25
00:02:14,220 --> 00:02:16,320
And I can copy this one.

26
00:02:16,320 --> 00:02:19,710
And for fetch single to I can throw the same error.

27
00:02:19,710 --> 00:02:23,340
So let's collapse this one and collapse this one.

28
00:02:23,340 --> 00:02:27,800
And now let's work with the first single, which is this one.

29
00:02:27,810 --> 00:02:28,560
Sorry.

30
00:02:28,560 --> 00:02:28,560
Right.

31
00:02:28,800 --> 00:02:33,240
So here, let's go ahead and then send the response.

32
00:02:33,390 --> 00:02:39,390
So here we go, start us as always, success

33
00:02:42,090 --> 00:02:47,830
and then the actual data as the transaction rate.

34
00:02:47,850 --> 00:02:50,700
So the next one going to be the deleting.

35
00:02:50,700 --> 00:02:55,650
So I may need the ID also here inside the delete root.

36
00:02:55,890 --> 00:03:05,490
So here we are going to find the transaction dot find by ID and then delete.

37
00:03:05,490 --> 00:03:18,150
So here we pass in the ID and here we send a status as success and then the actual data as now.

38
00:03:18,450 --> 00:03:26,850
And lastly, let's return the error here and for the update the same process we need ID.

39
00:03:26,880 --> 00:03:29,990
So here the ID comes here.

40
00:03:30,210 --> 00:03:36,510
And next step is that you are going to find the transaction by ID and then update.

41
00:03:36,510 --> 00:03:47,070
So it's equal to our which transaction dot find by ID and add date they pass in the ID.

42
00:03:47,220 --> 00:03:57,360
Second element is the entire object and then the optional configuration new to true and then run validators

43
00:03:57,360 --> 00:03:58,620
also to true.

44
00:03:58,860 --> 00:04:08,280
And let me bring in the error here down here meaning that I need to pass in the next and the same thing

45
00:04:08,310 --> 00:04:10,980
to this one also as next.

46
00:04:10,980 --> 00:04:16,350
So we are done with the entire operation for transaction in one video.

47
00:04:16,589 --> 00:04:20,490
So let's class all of them and now let's test the end point.

48
00:04:20,490 --> 00:04:24,090
So back here, let's open the transaction.

49
00:04:24,180 --> 00:04:32,700
So here, let's fetch all transactions and let's remove this one and let's see and this added transaction

50
00:04:32,700 --> 00:04:36,450
we have grade sorry, this one supposed to be single.

51
00:04:36,450 --> 00:04:38,250
So let's try again.

52
00:04:38,400 --> 00:04:44,670
Let's provide the ID here and let's send and indeed the single also is working.

53
00:04:44,670 --> 00:04:46,740
We go back on objects.

54
00:04:46,740 --> 00:04:48,600
That is a single record.

55
00:04:49,020 --> 00:04:56,700
The next step is about the updating so we can copy this one and which is what, buying moving sheets.

56
00:04:56,700 --> 00:05:04,800
So inside the update, which is this one, let's provide the ID and now and the body here.

57
00:05:04,800 --> 00:05:08,280
Let me explain it like this one and enter buddy.

58
00:05:08,310 --> 00:05:18,240
Let's change the name to let's say and let's send the request where I got some error.

59
00:05:18,240 --> 00:05:25,620
Meaning that on expired JSON format, meaning this one where I need to provide double code around it.

60
00:05:25,620 --> 00:05:27,060
Sorry guys, let's save it.

61
00:05:27,060 --> 00:05:28,230
And now let's get sent.

62
00:05:28,500 --> 00:05:35,010
And this is a response, meaning that we are not returning the response from the request.

63
00:05:35,010 --> 00:05:45,240
So here, here indeed we are returning this one status is equal to success and then the data can be

64
00:05:45,240 --> 00:05:49,440
found on the transaction and that is it.

65
00:05:49,440 --> 00:05:56,610
So let's go ahead and then update and you can see that the name has been changed to transportation.

