1
00:00:00,830 --> 00:00:06,170
None of us feared the method that is going to feature a diplomat API, so right beneath her, Constance

2
00:00:06,670 --> 00:00:09,560
will be creating a matter that is going to fetch your questions.

3
00:00:10,940 --> 00:00:12,860
So let's create a method.

4
00:00:16,940 --> 00:00:23,360
So this is the name of the matter that recreating now, since we are using an API call in this, that

5
00:00:23,360 --> 00:00:24,460
means we need to get data.

6
00:00:24,470 --> 00:00:30,770
Therefore, we are in agreement to use the keyword which we like to use the async when async functions.

7
00:00:30,770 --> 00:00:32,540
So this is going to be an async function.

8
00:00:35,110 --> 00:00:38,650
Now, let's importer Axios, because we'll be needing it.

9
00:00:39,160 --> 00:00:42,700
So if I just head up, so it has already been important for me.

10
00:00:43,180 --> 00:00:46,210
So all you have to do is just that we'll have to import.

11
00:00:50,790 --> 00:00:53,640
Axios from Axios.

12
00:00:54,660 --> 00:00:56,280
So it's done now.

13
00:01:01,120 --> 00:01:06,580
Now, what I want to do is that will be creating a constant so let's create a concert and the name of

14
00:01:06,580 --> 00:01:08,410
this constant is going to be a response.

15
00:01:08,560 --> 00:01:14,020
So this constant is going to be the response that is going to be equal to await.

16
00:01:15,180 --> 00:01:22,110
Because we want to tell that, hey, wait for this promise to resolve when we're done getting our data,

17
00:01:22,110 --> 00:01:23,040
then you can move forward.

18
00:01:23,670 --> 00:01:27,600
So now they will be pasting our data that we got from our API.

19
00:01:27,720 --> 00:01:30,210
So this is the temporary.

20
00:01:31,480 --> 00:01:37,540
API call that you're making now, if some sort of error occurs, then for that will be creating a catch

21
00:01:37,540 --> 00:01:38,200
statement.

22
00:01:39,570 --> 00:01:43,110
And if anything's full back then, just report an error.

23
00:01:44,210 --> 00:01:48,710
And all I want you to do is that is just going to allow this zero.

24
00:02:02,850 --> 00:02:09,500
All right, so this is that API call now after this, what I need to do is that will be creating a submit

25
00:02:09,500 --> 00:02:11,960
button that is going to be passed to a set up form.

26
00:02:12,410 --> 00:02:16,880
But before we do that, let me just not going to set up a different states.

27
00:02:17,030 --> 00:02:23,750
So right after our response, if our response has been true, if we have got some data, then is checking

28
00:02:23,750 --> 00:02:30,500
that if the response is true and if it is true, then what I want is that they will be creating contact

29
00:02:31,340 --> 00:02:35,330
data, which is going to be equal to this point.

30
00:02:36,970 --> 00:02:38,100
Stored data.

31
00:02:40,650 --> 00:02:41,610
The results.

32
00:02:48,880 --> 00:02:54,460
All right, so this is the data that we're getting from our results, I mean response now after this,

33
00:02:54,470 --> 00:02:58,810
if this is after this happens, they will be declaring a statement.

34
00:02:58,810 --> 00:03:04,840
And if Detroit or Flint, that means if we have some data inside our data content.

35
00:03:06,370 --> 00:03:10,780
Then what they want to do is that then they want to settle questions, then.

36
00:03:11,640 --> 00:03:12,720
Set questions.

37
00:03:14,900 --> 00:03:20,900
Because of the data that we have gotten, so will be setting up our questions, which initially is an

38
00:03:20,900 --> 00:03:26,470
empty area, but once we have gotten, our data will be setting up of questions now after we have settled

39
00:03:26,480 --> 00:03:31,880
about questions, what it is that will make sure that our loading as well as that we are, that means

40
00:03:31,880 --> 00:03:39,680
we have gotten our data from Arabia so that loading the files as well as circulating two files.

41
00:03:44,310 --> 00:03:50,910
And as I said, noting and said, reading will also be setting Ed Balls because there was no arrow inside

42
00:03:50,910 --> 00:03:54,810
application, so said error two equals so false.

43
00:03:56,010 --> 00:03:56,460
All right.

44
00:03:56,460 --> 00:04:01,890
So we have these three pieces of state and as if this happens, then we want to do this.

45
00:04:02,160 --> 00:04:08,790
And if they don't learn to zero, that means if I did not, load length is not true, then what do you

46
00:04:08,790 --> 00:04:09,270
want to do?

47
00:04:10,140 --> 00:04:11,580
Then we want to set.

48
00:04:15,850 --> 00:04:16,900
Then we want to.

49
00:04:20,760 --> 00:04:22,770
Make sure that are circulating.

50
00:04:25,750 --> 00:04:28,420
Is true as well, as I said, learning is true.

51
00:04:35,700 --> 00:04:41,040
Alright, so if I did not land is true, then we want to set questions to that data.

52
00:04:41,040 --> 00:04:44,130
We want to start loading the files, we want to get ready to file, we want to set ED.

53
00:04:44,640 --> 00:04:49,200
And if I returning to zero, then we want to rating to do as well as set out loading to true.

54
00:04:49,770 --> 00:04:55,770
Now, if our response is false, now this and this, if it actually nested under this particular, if

55
00:04:56,430 --> 00:05:01,720
this parent know if a parent is false, then what do you want to do then?

56
00:05:02,190 --> 00:05:05,250
And what are they going to put up?

57
00:05:05,250 --> 00:05:09,270
Is that said waiting to throw?

58
00:05:11,600 --> 00:05:17,780
All right, now, apart from this and the starting of a function right beneath right above our country

59
00:05:17,780 --> 00:05:20,690
response, they make sure there are certain loading.

60
00:05:23,440 --> 00:05:29,050
It's true because we haven't actually faced any sort of detail apart from that loading, we'll also

61
00:05:29,140 --> 00:05:30,910
be putting set waiting to false.

62
00:05:32,470 --> 00:05:34,300
So sit waiting.

63
00:05:36,210 --> 00:05:41,220
True, false, because at this point of time, we are waiting for our data to be finished, but our

64
00:05:41,220 --> 00:05:42,060
application is ready.

65
00:05:44,780 --> 00:05:47,360
All right, so we have set it up a function.

66
00:05:47,630 --> 00:05:53,840
Now we need to call this function and four which will be creating another method insider context logistics.
