1
00:00:00,750 --> 00:00:01,350
Welcome back.

2
00:00:01,950 --> 00:00:07,220
Now what we did, what we need to do is that we need to delete a movie from our database, so to speak.

3
00:00:07,230 --> 00:00:08,260
Of course, this is not edited.

4
00:00:08,460 --> 00:00:09,150
This is an error.

5
00:00:10,140 --> 00:00:13,740
So how can we delete that movie before I delete the movie here?

6
00:00:13,740 --> 00:00:14,370
I added.

7
00:00:14,400 --> 00:00:16,830
Let me show you that they added a few movies.

8
00:00:16,830 --> 00:00:21,180
We have one two three four five six lists this year.

9
00:00:21,210 --> 00:00:22,050
Let me refresh.

10
00:00:22,860 --> 00:00:30,480
Let me show you that if I click on movies and then if you click on Dried-out Excuse, I'm going to get

11
00:00:30,480 --> 00:00:31,110
all of the movies.

12
00:00:31,530 --> 00:00:35,880
So here, as you can see, we have this one two three four five.

13
00:00:35,880 --> 00:00:37,200
So we have all of the movies here.

14
00:00:37,740 --> 00:00:40,470
Now, suppose that we want to delete a specific movie.

15
00:00:41,520 --> 00:00:41,910
Delete.

16
00:00:42,090 --> 00:00:48,150
Deleting a movie is very, very simple and probably the easiest thing to do whenever you are working

17
00:00:48,150 --> 00:00:50,280
with with ICE.

18
00:00:51,030 --> 00:00:57,300
It only requires providing the API with the the the movie ID.

19
00:00:57,420 --> 00:00:57,960
That's it.

20
00:00:58,830 --> 00:01:05,580
So it's similar to getting a specific movie, but the difference is that instead of getting that movie,

21
00:01:05,580 --> 00:01:06,510
we need to delete it.

22
00:01:07,110 --> 00:01:13,650
So to do it, to delete the movie, we need to say up and create a new route and the the method used.

23
00:01:13,710 --> 00:01:16,710
The HTP method used is delete.

24
00:01:17,550 --> 00:01:18,030
Delete.

25
00:01:19,400 --> 00:01:24,230
And then since we are deleting a movie, we are going to know the idea of that movie.

26
00:01:24,800 --> 00:01:31,640
Therefore, I'm going to say your movie and then of course, last and then I'm going to pass the movie.

27
00:01:32,910 --> 00:01:33,170
I.

28
00:01:35,390 --> 00:01:37,130
And then they function, I'm going to say this.

29
00:01:38,530 --> 00:01:39,040
Delete.

30
00:01:41,320 --> 00:01:41,950
Delete.

31
00:01:45,070 --> 00:01:49,060
Underscore and again, I want you to pay attention.

32
00:01:49,600 --> 00:01:53,320
I want you to pay attention to the structure one more time.

33
00:01:54,040 --> 00:02:00,370
We always start with the app and then we specify the method, the method in case of delete, of course,

34
00:02:00,400 --> 00:02:07,140
delete, and then we provide the the method with the structure of the new audio.

35
00:02:07,810 --> 00:02:14,230
So again, the structure of your email must be meaningful here movie because we want to delete something

36
00:02:14,230 --> 00:02:16,720
movie we need to do, we need to delete a movie.

37
00:02:17,230 --> 00:02:23,140
And then in case we have this, we need to provide that you are ill with it or something.

38
00:02:23,350 --> 00:02:30,680
So in our case, we are providing that endpoint with an I.D. and then by law that we need to create

39
00:02:30,680 --> 00:02:34,480
the function that would be called whenever we go through this ordeal.

40
00:02:35,320 --> 00:02:41,860
And then since we passed the movie ID, we need to pass it here in the function, which is a movie ID

41
00:02:42,640 --> 00:02:43,900
and the type is integer.

42
00:02:44,650 --> 00:02:49,480
And then in the function we need to do, we need to to delete that movie.

43
00:02:50,050 --> 00:02:57,610
So to delete a movie from an IRA, we need first access the array rate when using movies and then the

44
00:02:57,610 --> 00:03:01,450
function that is used to delete something from an error is called pop.

45
00:03:02,350 --> 00:03:07,460
And then you need to provide this function with the with the ID of that movie.

46
00:03:07,510 --> 00:03:16,120
I'm going to take your movie ID and then return, and then you can return with anything typically in

47
00:03:16,120 --> 00:03:18,850
your in, in, in real API's.

48
00:03:19,270 --> 00:03:22,390
They return with nothing or with success.

49
00:03:22,390 --> 00:03:25,270
Message with a message here message.

50
00:03:26,380 --> 00:03:26,890
And then.

51
00:03:29,280 --> 00:03:29,730
Movie.

52
00:03:30,890 --> 00:03:32,630
Has been.

53
00:03:33,910 --> 00:03:34,600
Deleted.

54
00:03:35,880 --> 00:03:38,550
So successfully.

55
00:03:40,250 --> 00:03:41,420
That's it's pretty simple.

56
00:03:41,780 --> 00:03:46,250
Now let's test this lady now head on over to the browser first and let me refresh.

57
00:03:47,480 --> 00:03:48,870
And now we should have a new.

58
00:03:49,520 --> 00:03:57,530
You are able, as you can see here, we have a new endpoint called movie for slash movie ID, and the

59
00:03:57,530 --> 00:03:58,430
method is delete.

60
00:03:59,150 --> 00:04:04,130
In order to use this method first week to say try it out and then we need to provide the name of the

61
00:04:04,130 --> 00:04:04,430
movie.

62
00:04:04,880 --> 00:04:08,750
Before I provide the name of the movie, let's check which movie we want to delete.

63
00:04:08,900 --> 00:04:12,860
So we have one two three four one two three four five.

64
00:04:12,870 --> 00:04:13,730
We have five movies.

65
00:04:14,300 --> 00:04:16,220
Let's delete the last movie.

66
00:04:16,670 --> 00:04:20,450
So the last movie has an idea of one, two, three, four or five.

67
00:04:21,200 --> 00:04:22,400
Let's delete five.

68
00:04:22,460 --> 00:04:24,290
I'm going to say you're five now.

69
00:04:24,290 --> 00:04:25,310
Then I'm going to execute.

70
00:04:27,210 --> 00:04:32,040
And as you can see here, it a message movie has been deleted successfully.

71
00:04:32,760 --> 00:04:36,690
So how can how can we verify that the movie has been deleted?

72
00:04:37,170 --> 00:04:46,230
Well, we can go back to the movies and then we can execute this movies and we check the movies that

73
00:04:46,230 --> 00:04:46,530
we have.

74
00:04:47,010 --> 00:04:51,420
So now if we check the movies that we have, we now have one, two, three four movies.

75
00:04:51,900 --> 00:04:54,970
So the fifth movie is no longer there.

76
00:04:54,990 --> 00:04:58,350
The fifth movie has been deleted, so it doesn't exist.

77
00:04:58,950 --> 00:05:00,750
So it has been deleted successfully.

78
00:05:01,140 --> 00:05:07,080
So this is how we can delete a movie, and this is how we can verify that the movie has been deleted.
