1
00:00:00,900 --> 00:00:01,530
Welcome back.

2
00:00:01,920 --> 00:00:09,330
Now what we need to do is that we need to update a movie and as you can see, we already have a urinal

3
00:00:09,330 --> 00:00:13,230
that or an endpoint that does this, so I'm going to uncomment this good.

4
00:00:13,890 --> 00:00:20,160
However, this time we aren't going to update the movie in the front end.

5
00:00:20,160 --> 00:00:25,710
And instead, this time we are going to be updating a movie in the database, which is which means that

6
00:00:25,710 --> 00:00:28,530
it's a a real API.

7
00:00:29,220 --> 00:00:33,270
So now the difference is that we need to use scale here.

8
00:00:33,810 --> 00:00:41,040
So we record is going to be the same, except for getting the movie from the user and then inserting

9
00:00:41,040 --> 00:00:44,040
and then updating the movie that already exists in the database.

10
00:00:44,820 --> 00:00:54,050
So here what we need to do is that as usual, the first step is that we need to access the database.

11
00:00:54,060 --> 00:00:57,600
So we need we need your gear, we need to get the movie.

12
00:00:58,140 --> 00:01:04,340
We need to do it first through to create or excuse to say Esquibel and then the school.

13
00:01:05,010 --> 00:01:07,770
So the school command that's used to update something.

14
00:01:08,160 --> 00:01:12,600
In our case, it's a movie is update update.

15
00:01:13,500 --> 00:01:16,890
And then what do we want to update, we want to update movies.

16
00:01:17,880 --> 00:01:19,890
And then the values that we want to update.

17
00:01:19,890 --> 00:01:24,750
So I'm going to say update movies, set, set, what do we want to update?

18
00:01:24,750 --> 00:01:25,800
We want to update the.

19
00:01:27,330 --> 00:01:27,840
Title.

20
00:01:29,470 --> 00:01:34,900
Title and title of it is equal to and then.

21
00:01:35,900 --> 00:01:38,990
Percentage, yes, because we want to add a blank here.

22
00:01:39,990 --> 00:01:43,320
And then we also need to update, we need to say, come on.

23
00:01:43,920 --> 00:01:45,690
And then we need to update the year.

24
00:01:46,170 --> 00:01:49,440
So I'm going to say a year is equal to percentage.

25
00:01:50,650 --> 00:01:50,960
Yes.

26
00:01:51,760 --> 00:01:52,830
And then come on.

27
00:01:53,590 --> 00:02:00,880
And then story line and then is equal to and then percentage.

28
00:02:01,210 --> 00:02:01,630
Yes.

29
00:02:02,200 --> 00:02:08,050
And then what's important now is that we need to add the condition because we eat a bit as single movie,

30
00:02:08,050 --> 00:02:09,070
a specific movie.

31
00:02:09,430 --> 00:02:17,800
So we have to say where where it is equal to percentages, we need another blank.

32
00:02:18,430 --> 00:02:23,280
Now what we want to do is that we want to get them to get the movie from the user.

33
00:02:24,010 --> 00:02:29,170
So here we to say Val is equal to and then you pull and then.

34
00:02:30,160 --> 00:02:30,790
Movie.

35
00:02:31,910 --> 00:02:39,380
Movie and then the first thing that we need to attend is the title, so we need to say movie title and

36
00:02:39,380 --> 00:02:42,230
then comma, and then we update the movie.

37
00:02:43,890 --> 00:02:44,540
A year.

38
00:02:47,930 --> 00:02:52,250
And then calmer and then movie story line.

39
00:02:55,140 --> 00:03:02,400
And finally, what do you do when you say move, come and then movie in the movie, it is a single value.

40
00:03:02,400 --> 00:03:10,350
So we just say we just need to say movie I.D. We just need to say we we we just need to say your movie.

41
00:03:13,180 --> 00:03:17,260
And that's it now after we do this, we have to say.

42
00:03:18,740 --> 00:03:19,250
Movie.

43
00:03:21,140 --> 00:03:23,960
We have to say my cursor and then execute.

44
00:03:24,890 --> 00:03:31,960
And then we need to execute the scale with the value so that we have the value or values to the squirrel.

45
00:03:32,330 --> 00:03:39,200
And finally, since we are, we are changing something we are we are altering something we have to say.

46
00:03:39,560 --> 00:03:41,300
We have to call the comment function.

47
00:03:41,660 --> 00:03:47,470
So I'm going to say my database that's coming and we return.

48
00:03:47,480 --> 00:03:55,400
We can't see any return and we return the movie that has been updated, which means the movie and we

49
00:03:55,400 --> 00:03:56,510
don't need any of this.

50
00:03:56,720 --> 00:03:58,910
So I'm going to remove all of these.

51
00:04:00,550 --> 00:04:01,930
We don't need this court anymore.

52
00:04:02,350 --> 00:04:07,360
Let me click now on file on the table and let's say, then oversee the browser test.

53
00:04:08,230 --> 00:04:11,650
So now in the browser, we have to refresh.

54
00:04:12,680 --> 00:04:17,510
As you can see, we will have a New York IL avait movie now with this, you are ill.

55
00:04:18,080 --> 00:04:25,460
We need we need to click on dried up and then we need to provide two things we need to provide ID.

56
00:04:26,300 --> 00:04:32,840
So the movie that they want to update, let's say Rio, the last movie, which has an 80 100 one.

57
00:04:33,500 --> 00:04:41,090
So I'm going to say here 101 and then we need to pass or insert the new data.

58
00:04:41,720 --> 00:04:42,980
So first, the title.

59
00:04:44,090 --> 00:04:48,530
So if you don't want to edit or change the title, you just need to pass the old title.

60
00:04:48,860 --> 00:04:50,570
So the old title is going to be the same.

61
00:04:51,230 --> 00:04:52,840
However, I'm going to change the year.

62
00:04:52,850 --> 00:04:53,780
I'm going to say a year.

63
00:04:56,290 --> 00:04:57,100
I'm going to say a year.

64
00:04:58,970 --> 00:05:04,490
And then I'm going to change this to, let's say, two thousand twenty five, just for the sake of this

65
00:05:04,490 --> 00:05:09,350
thing and then storyline, I'm going to say story line.

66
00:05:13,100 --> 00:05:17,020
Also, movie just for the sake of this thing again.

67
00:05:17,510 --> 00:05:22,700
Now if you click on excuse, guess what, if you click on excuse that says you're two hundred?

68
00:05:23,150 --> 00:05:24,380
And here the new data.

69
00:05:24,710 --> 00:05:27,080
Let's verify that the movie has been updated.

70
00:05:27,320 --> 00:05:29,900
Now in the database, let me refresh the movie stable.

71
00:05:30,380 --> 00:05:36,200
And as you can see, the new data has been inserted or the data has been updated, I should say.

72
00:05:36,590 --> 00:05:40,640
So here this movie now has a year of 2020.

73
00:05:40,640 --> 00:05:42,440
Five three storyline saves a year.

74
00:05:42,770 --> 00:05:43,460
Awesome movie.

75
00:05:43,910 --> 00:05:46,190
So it has been updated successfully.
