1
00:00:00,180 --> 00:00:00,540
Awesome.

2
00:00:00,600 --> 00:00:03,330
And now it's knockout update review as well.

3
00:00:03,930 --> 00:00:09,030
Again, we're looking for I.D. because it is strengthening the right to bear arms.

4
00:00:09,550 --> 00:00:14,880
And just like in the user, when we want to update the user, will you save?

5
00:00:15,150 --> 00:00:18,190
And again, this will make sense in a few videos.

6
00:00:18,270 --> 00:00:19,080
Please be patient.

7
00:00:19,710 --> 00:00:24,650
And therefore, we want to pull out from the rock body, not email and name.

8
00:00:24,720 --> 00:00:28,860
In our case, we're going to be looking for rating, title and comment.

9
00:00:29,400 --> 00:00:33,090
And again, yes, normally it's just going to be coming from the front.

10
00:00:33,090 --> 00:00:39,270
And like I covered when we were updating the user, then we want to check with our review actually exists

11
00:00:39,810 --> 00:00:42,810
based on the idea that we have incorrect background.

12
00:00:42,810 --> 00:00:49,080
If no review and for or for right, we want to use check permissions and you just need to remember why

13
00:00:49,080 --> 00:00:51,180
we need to pass in off that.

14
00:00:51,180 --> 00:00:54,680
We want to set properties one by one.

15
00:00:54,690 --> 00:00:57,750
Again, we're not using find one and update.

16
00:00:58,290 --> 00:01:04,319
So remember how we did in the user one by one, we got the property and we set it equal to the value

17
00:01:04,319 --> 00:01:04,980
that's coming in.

18
00:01:05,470 --> 00:01:11,640
We want to use a review safe and at the very, very end we'll send back two hundred.

19
00:01:12,240 --> 00:01:17,850
And like already mentioned, pretty much it is going to be the copy of Delete.

20
00:01:18,000 --> 00:01:24,870
The only difference is getting the value from the rock that body and then setting them up one by one.

21
00:01:25,380 --> 00:01:28,590
So we are looking for more of your controller.

22
00:01:29,370 --> 00:01:35,370
We want to go here, and in this case, I'm just going to take the entire thing or commit copy and paste

23
00:01:36,330 --> 00:01:37,770
in the update review.

24
00:01:38,220 --> 00:01:40,800
We're still looking for daddy that's coming from params.

25
00:01:40,800 --> 00:01:47,910
Not a difference in this case is a rating that's going to be sitting in the wrong that body title and

26
00:01:47,910 --> 00:01:48,420
comment.

27
00:01:49,110 --> 00:01:54,690
So those three things and that is equal to Iraq, and in this case, we're looking for a body.

28
00:01:55,290 --> 00:01:56,190
I'll save.

29
00:01:56,760 --> 00:01:58,820
We'll still look for that review.

30
00:01:59,670 --> 00:02:01,530
We'll check whether reviews exist.

31
00:02:01,950 --> 00:02:10,080
We'll still check for permissions because I don't want Peter to update Susan's review or other way around.

32
00:02:10,620 --> 00:02:12,030
And instead of removed, remove.

33
00:02:12,630 --> 00:02:14,130
First, we'll go with Save.

34
00:02:15,100 --> 00:02:18,330
And then in between the check permissions and safe.

35
00:02:18,670 --> 00:02:23,050
Now, like I said, we have access to that single review if it exists.

36
00:02:23,440 --> 00:02:28,780
So in this case, we'll go with a review rating is equal to eight rating and then copy and paste.

37
00:02:28,780 --> 00:02:29,860
And now we're just one to change.

38
00:02:29,860 --> 00:02:32,410
These values are on where instead of rating.

39
00:02:32,950 --> 00:02:34,360
I'll be looking for a title.

40
00:02:34,720 --> 00:02:36,850
So let me set it over here as a title.

41
00:02:37,240 --> 00:02:41,380
I'm not in the next line of credit, equal to a comment.

42
00:02:41,870 --> 00:02:46,630
And once we have set all these three properties, we're good to go.

43
00:02:47,260 --> 00:02:50,500
The only thing that's missing is the review in the response.

44
00:02:50,830 --> 00:02:58,660
So reviews are you save and mine instead of message or send back the single over you say here review.

45
00:02:59,050 --> 00:03:03,520
So now let's try to update first the Peters comment.

46
00:03:03,880 --> 00:03:05,290
I'm not if we're successful.

47
00:03:05,590 --> 00:03:08,710
Let's try to do the same thing with Susan one.

48
00:03:09,220 --> 00:03:12,240
So I'm going to hop back to a postman.

49
00:03:12,790 --> 00:03:14,350
And let me see.

50
00:03:14,530 --> 00:03:20,590
Actually, I need to create one more time review because if I remember correctly were actually deleted.

51
00:03:20,950 --> 00:03:22,240
So let's send notice.

52
00:03:22,240 --> 00:03:23,410
We're not getting back the error.

53
00:03:23,710 --> 00:03:30,640
That means that there isn't already existing review, and therefore I can just grab the I.D. now.

54
00:03:31,510 --> 00:03:33,240
So I have that, are you?

55
00:03:33,310 --> 00:03:34,090
Let me take it.

56
00:03:34,510 --> 00:03:38,020
And then in the update review, we'll pass it.

57
00:03:38,680 --> 00:03:41,680
And then just so I can speed this up a little bit.

58
00:03:42,680 --> 00:03:44,330
I'm just going to grab these three things.

59
00:03:44,750 --> 00:03:46,680
So I'm looking for rating title uncommon.

60
00:03:46,700 --> 00:03:52,100
Those are the things that my front end is looking for and or I'm sorry back.

61
00:03:52,640 --> 00:03:53,270
I apologize.

62
00:03:53,990 --> 00:03:58,730
And you want to set them up in our interview or body rather.

63
00:03:59,650 --> 00:04:05,530
And John, and now let's go with these three values, and I'm just going to change that the wrong,

64
00:04:05,650 --> 00:04:08,080
Ralph said that rating is one.

65
00:04:08,830 --> 00:04:14,440
And again, this will be a bad one, bad product, very, very bad product.

66
00:04:14,740 --> 00:04:18,500
And I'll leave by Peter just so I know which one.

67
00:04:18,519 --> 00:04:22,029
Otherwise, I'll have to compare the ideas, and I don't want to do that.

68
00:04:22,510 --> 00:04:24,070
So let's send this one in.

69
00:04:24,550 --> 00:04:30,580
And then if we take a look at all the products or I'm sorry, if I take a look at all the reviews,

70
00:04:30,580 --> 00:04:34,630
that's what I was trying to say, then I can see that I have two of them.

71
00:04:35,050 --> 00:04:39,460
One is done by Susan and the other one is done by Peter.

72
00:04:39,700 --> 00:04:40,120
Correct.

73
00:04:40,480 --> 00:04:48,310
And now let's try to do the same thing with Susan's review Where if I go to Update Review Pass her,

74
00:04:48,400 --> 00:04:48,900
review it.

75
00:04:49,600 --> 00:04:52,360
And let's just change around to five again.

76
00:04:53,110 --> 00:04:58,240
And I'm not going to change anything else around because we're not going to be authorized to access

77
00:04:58,240 --> 00:04:59,140
this drought to begin with.

78
00:04:59,740 --> 00:05:05,080
So with this in place, we pretty much have knocked out the stuff that we already covered.

79
00:05:05,770 --> 00:05:12,220
So now let's start exploring some goodies that we haven't talked about in the previous project.

