1 00:00:00,750 --> 00:00:03,260 We can remove items from our cart. 2 00:00:03,570 --> 00:00:09,270 So now let's start working on the increase and decrease, and again, we're going to do a bit of a set 3 00:00:09,270 --> 00:00:15,690 up first and then one by one, we'll take a look at the functionality because they're a bit more complicated 4 00:00:15,870 --> 00:00:18,660 than just remove or clearing the cart. 5 00:00:19,050 --> 00:00:25,590 So I'm going to start by setting up the cart item where instead of just having a remove prop course, 6 00:00:25,590 --> 00:00:29,620 I also would want to have props for increase and decrease. 7 00:00:29,910 --> 00:00:33,180 So let me start a new line and line in this case. 8 00:00:33,510 --> 00:00:35,550 Maybe let me make this one smaller. 9 00:00:35,760 --> 00:00:41,730 It's going to be easier for me to copy and paste and copy and paste and maybe right away add some commas 10 00:00:41,730 --> 00:00:41,970 here. 11 00:00:42,450 --> 00:00:46,080 And as far as the names we're going to go with increase. 12 00:00:47,160 --> 00:00:50,850 Increase and then decrease, decrease. 13 00:00:51,150 --> 00:00:52,770 So what things we need to change here? 14 00:00:53,100 --> 00:00:56,760 Well, of course, we're not going to dispatch or move or increase. 15 00:00:56,760 --> 00:00:59,330 We would want to dispatch increase. 16 00:00:59,580 --> 00:01:04,380 We'll still pass the payload because we will look for that specific item. 17 00:01:04,500 --> 00:01:05,930 So that will stay the same. 18 00:01:06,270 --> 00:01:07,870 But as far as the decrease. 19 00:01:08,160 --> 00:01:14,000 I also want to check the amount, the amount that is in the home perhaps. 20 00:01:14,220 --> 00:01:19,620 So why we're checking the amount because if we're taking a look at the finished application, you can 21 00:01:19,620 --> 00:01:22,110 see that I can increase costs for all of them. 22 00:01:22,350 --> 00:01:29,140 But then as far as decreasing, if the amount for that specific item is more than one, well, then 23 00:01:29,140 --> 00:01:32,030 we'll just decrease the item here and here. 24 00:01:32,280 --> 00:01:36,750 But if the amount is less than one, then we just remove it from the cart. 25 00:01:37,120 --> 00:01:42,810 That's why not only we will pass the ID like we have for remove and increase. 26 00:01:43,140 --> 00:01:49,930 We also will be structured from the on perhaps the amount and I again remember it is in the actual core 27 00:01:49,980 --> 00:01:50,370 items. 28 00:01:50,640 --> 00:01:53,400 So you can clearly see that particular property there. 29 00:01:53,650 --> 00:02:00,240 And then in the payload, not only will pass the ID like we have done already for over an increase, 30 00:02:00,630 --> 00:02:03,820 but we will also do the same thing with the amount. 31 00:02:03,990 --> 00:02:06,990 So those are two things we will need in decrease. 32 00:02:07,230 --> 00:02:09,250 So extra will be an amount. 33 00:02:09,510 --> 00:02:12,000 And then since I have both of these props right now. 34 00:02:13,050 --> 00:02:20,460 I can scroll up and not only I'm looking for her move, I'm also looking for increase and decrease and 35 00:02:20,460 --> 00:02:23,130 I can already see that I'm not using my variable. 36 00:02:23,580 --> 00:02:25,290 Of course, there will be a mistake. 37 00:02:25,530 --> 00:02:29,790 So now let me change the decrease action type to a decrease. 38 00:02:30,290 --> 00:02:31,120 My apologies. 39 00:02:31,500 --> 00:02:33,280 Now let's continue. 40 00:02:33,300 --> 00:02:39,570 We have increase and then, of course, we have decreased and the setup will be exactly the same like 41 00:02:39,570 --> 00:02:41,310 we have for remove. 42 00:02:41,560 --> 00:02:42,960 Let me just point those buttons. 43 00:02:42,960 --> 00:02:47,010 I can see that I have increased amount and decrease the amount. 44 00:02:47,400 --> 00:02:54,480 So same spiel we go with on oncolytic is equal to overall function since we would want to run it when 45 00:02:54,480 --> 00:02:55,380 we click on a button. 46 00:02:55,830 --> 00:03:03,240 So in this case, since it is increase, I'm going to invoke my increased prop and then I'm also going 47 00:03:03,240 --> 00:03:05,580 to do the same thing with my decrease button. 48 00:03:05,800 --> 00:03:13,060 But in order to speed things up, I'm just going to copy what we wrote and copy and paste it here where 49 00:03:13,060 --> 00:03:14,240 I have the decrease button. 50 00:03:14,730 --> 00:03:20,760 And of course, the only thing we need to change right now is the prop or the function that we will 51 00:03:20,760 --> 00:03:21,320 invoke. 52 00:03:21,600 --> 00:03:24,990 So instead of increase, we will go with decrease. 53 00:03:25,440 --> 00:03:26,970 Now, again, let me click. 54 00:03:27,120 --> 00:03:28,770 We should see you increase the amount. 55 00:03:29,060 --> 00:03:29,290 Awesome. 56 00:03:29,520 --> 00:03:30,150 Now works. 57 00:03:30,150 --> 00:03:32,790 And then also we should help you decrease the amount. 58 00:03:33,150 --> 00:03:38,700 So we correctly connected our car item component to our dispatch. 59 00:03:38,910 --> 00:03:42,900 So now of course, we just need to take care of the functionality in the user.