1
00:00:00,720 --> 00:00:01,350
Welcome back.

2
00:00:01,800 --> 00:00:08,370
Now what we need to do is that we need to delete a movie from the database, so remember we already

3
00:00:08,370 --> 00:00:13,700
have here an endpoint and this endpoint deletes a movie from an array.

4
00:00:14,100 --> 00:00:18,120
However, now we need to delete that movie from the database.

5
00:00:18,570 --> 00:00:27,120
So the difference here is that now we are using a true API which connects with the database, and now

6
00:00:27,120 --> 00:00:29,580
we can delete a movie from the database.

7
00:00:29,940 --> 00:00:33,630
So the first step is that we need to use this key IL here.

8
00:00:33,630 --> 00:00:38,820
I'm going to say this cool and then it's going to be equal to and then they ask you, it'll come out.

9
00:00:39,270 --> 00:00:42,680
So the issue will come out that deletes something from the database.

10
00:00:42,690 --> 00:00:47,370
In our case, it's a movie is delete, delete.

11
00:00:48,120 --> 00:00:56,970
And then what you want to delete is that we want to delete from from movies, from movies, where,

12
00:00:57,480 --> 00:01:05,010
where and then if we need to specify the movie idea, I'm going to say it is equal to percentages,

13
00:01:05,010 --> 00:01:06,270
so we need to append.

14
00:01:06,630 --> 00:01:09,630
I'm going to say, Well, we end up in the movie idea.

15
00:01:09,660 --> 00:01:14,370
I'm going to say, Val is equal to you and then you will and then the movie ID.

16
00:01:14,490 --> 00:01:17,150
So we need the movie, every movie idea.

17
00:01:17,160 --> 00:01:18,600
And then I don't forget the comma.

18
00:01:19,710 --> 00:01:24,720
And finally, we need to execute this, so we need to say, Mike or sir.

19
00:01:25,760 --> 00:01:26,360
That.

20
00:01:27,350 --> 00:01:27,800
That.

21
00:01:28,820 --> 00:01:33,560
Execute on what what do you want to execute, there's nothing you want to execute the rescue ill with

22
00:01:33,560 --> 00:01:36,560
the value, and we no longer need this pop.

23
00:01:36,800 --> 00:01:38,360
I'm going to remove this function.

24
00:01:40,440 --> 00:01:46,020
And we need to return a message that says movie has been deleted successfully.

25
00:01:46,470 --> 00:01:47,790
Let's now get something here.

26
00:01:47,820 --> 00:01:51,570
Click on file and then save all.

27
00:01:52,110 --> 00:01:54,620
However, if you say this, it's not going to work.

28
00:01:54,630 --> 00:01:55,050
Why?

29
00:01:55,530 --> 00:02:02,100
Because as they told you, whenever you are altering or deleting or updating or creating something,

30
00:02:02,100 --> 00:02:03,780
you have to call the comment function.

31
00:02:04,620 --> 00:02:07,500
So here it is a mine database.

32
00:02:07,710 --> 00:02:08,670
Dot com.

33
00:02:10,200 --> 00:02:12,740
So this without this, it's not going to work.

34
00:02:12,750 --> 00:02:14,220
So this is super important.

35
00:02:14,230 --> 00:02:15,240
This function is important.

36
00:02:16,050 --> 00:02:17,580
Now let's save one more time.

37
00:02:19,470 --> 00:02:19,570
And.

38
00:02:20,840 --> 00:02:23,240
Now let me turn over to the browser and let me a refresh.

39
00:02:23,940 --> 00:02:25,370
And let's delete a movie.

40
00:02:25,700 --> 00:02:28,880
So as you can see in this race, we have one two three four five.

41
00:02:29,450 --> 00:02:30,500
We have five movies.

42
00:02:30,980 --> 00:02:37,910
Let's delete the latest movie, the last movie, which is real and it has an idea of 101.

43
00:02:38,720 --> 00:02:39,920
So what I'm going to do is that.

44
00:02:41,380 --> 00:02:47,890
I'm going to hear click on dried out and then I'm going to pass on the movie idea, which is 101, and

45
00:02:47,890 --> 00:02:49,180
then we're going to click on Execute.

46
00:02:50,110 --> 00:02:54,790
And as you can see, I'm going to get a message that says movie has been deleted successfully.

47
00:02:55,300 --> 00:03:00,040
So now you have two ways to verify that the movie has been deleted, either.

48
00:03:00,070 --> 00:03:04,750
Either you can go through the database and refresh the database, and you will find that.

49
00:03:05,200 --> 00:03:08,400
Now we don't have the last movie anymore.

50
00:03:08,410 --> 00:03:12,550
We have one, two, three, four or eight or 10 rather than five movies.

51
00:03:13,030 --> 00:03:20,590
Also, you can get all of the movies and check that you can hear, say, movies and then click on,

52
00:03:20,590 --> 00:03:24,940
try it out and then execute, and you will find that the last movie doesn't exist.

53
00:03:25,510 --> 00:03:26,800
Also, you can.

54
00:03:27,310 --> 00:03:33,120
You can use the Get movie by HD and you can pass the movie ID.

55
00:03:33,280 --> 00:03:39,460
So if they say 101, which is the idea of the movie that has been deleted, and if you click on excuse

56
00:03:39,670 --> 00:03:45,610
now you are going to get an error here and internal server error because the movie doesn't exist.

57
00:03:46,240 --> 00:03:54,550
So this is how you can delete a resource in our case, a movie from Reality-Based using the delete method

58
00:03:54,550 --> 00:03:55,810
of this end point.
