1
00:00:00,570 --> 00:00:08,340
In this video, we are going to populate the rare author above the comments and display it accordingly

2
00:00:08,340 --> 00:00:09,840
as you see here.

3
00:00:09,990 --> 00:00:16,590
So how are we going to get it done unless we get back to the API of the posts and let's see how we are

4
00:00:16,590 --> 00:00:18,120
going to populate that.

5
00:00:18,240 --> 00:00:24,690
So let's get back to post controller and this is the field for fetching single posts.

6
00:00:24,810 --> 00:00:29,960
So this is where we have the user which is inside the command.

7
00:00:29,970 --> 00:00:37,200
So for this we are going to use this special syntax so that we can pre populate the nested ID and that

8
00:00:37,200 --> 00:00:38,130
is the user.

9
00:00:38,130 --> 00:00:44,280
So here I'm going to use object and then the path for this is going to be command.

10
00:00:44,550 --> 00:00:52,320
And inside the command we have a field called user, so going to be populate and then user.

11
00:00:53,860 --> 00:00:57,100
The path for this is user.

12
00:00:57,970 --> 00:01:02,350
All right, So let's save it and let's make the request.

13
00:01:02,590 --> 00:01:06,190
Refresh it and let's check our console.

14
00:01:06,220 --> 00:01:08,320
That is our terminal instead.

15
00:01:08,560 --> 00:01:12,850
And you can see we have the user being populated with the object.

16
00:01:12,850 --> 00:01:19,890
So now we can use the user foo name or user profile image.

17
00:01:19,900 --> 00:01:21,690
So moment of truth.

18
00:01:21,700 --> 00:01:25,900
So let's get back to the post details and this is where we are looping through.

19
00:01:25,930 --> 00:01:30,270
So in here we have access to the user.

20
00:01:30,280 --> 00:01:32,530
So let's go ahead and display the image.

21
00:01:32,530 --> 00:01:39,370
Remember on the command, we have the user, as you saw inside the console going to be the comment.

22
00:01:39,370 --> 00:01:43,750
Here we have the user and then the profile image of the user.

23
00:01:43,750 --> 00:01:47,590
So save it and let's refresh it and let's see.

24
00:01:48,460 --> 00:01:50,620
Let's click on continue reading.

25
00:01:52,440 --> 00:01:54,570
And we have the image of the user.

26
00:01:54,600 --> 00:01:58,020
You can see this is me that is a look in user.

27
00:01:58,380 --> 00:02:03,620
If I go to my profile page, you can see that these are the posts that I've created.

28
00:02:03,630 --> 00:02:10,020
And if I click on this one, you can see that indeed it belongs to me.

29
00:02:10,020 --> 00:02:13,480
And it was me who added this comment.

30
00:02:13,500 --> 00:02:19,620
So if I add one more comment and for this, let me add some dummy text here.

31
00:02:20,320 --> 00:02:21,580
And create.

32
00:02:22,930 --> 00:02:28,170
Suck six and let's refresh it and I have to comment.

33
00:02:28,180 --> 00:02:33,700
So let me add the name also, and here I'm going to use this one.

34
00:02:35,330 --> 00:02:36,980
And the name.

35
00:02:36,980 --> 00:02:37,450
Sorry.

36
00:02:37,460 --> 00:02:38,900
This one instead.

37
00:02:39,810 --> 00:02:42,960
And it's going to be full name.

38
00:02:44,760 --> 00:02:46,590
The date also.

39
00:02:47,210 --> 00:02:50,870
And it's equal to the created at.

40
00:02:53,060 --> 00:02:59,030
And I want to convert to low car date.

41
00:02:59,910 --> 00:03:00,840
String.

42
00:03:02,970 --> 00:03:03,960
All right, stats.

43
00:03:03,960 --> 00:03:06,540
So let's refresh it.

44
00:03:07,700 --> 00:03:10,010
And we have it as Emma.

45
00:03:10,090 --> 00:03:14,390
Emma, if I look in as different person.

46
00:03:14,390 --> 00:03:17,630
So let me look out and look in as Ben.

47
00:03:17,630 --> 00:03:20,570
I think for Ben, I forgot the email.

48
00:03:22,120 --> 00:03:23,220
Or the password.

49
00:03:23,230 --> 00:03:24,820
One, two, three, four, five.

50
00:03:24,850 --> 00:03:25,570
Let me see.

51
00:03:25,900 --> 00:03:27,160
Well, invalid.

52
00:03:27,280 --> 00:03:28,780
So let me register.

53
00:03:29,110 --> 00:03:31,810
Different person asked from us.

54
00:03:49,630 --> 00:03:52,630
So now let me go ahead and comment a post.

55
00:03:52,960 --> 00:03:55,630
So I want to comment this post.

56
00:03:56,570 --> 00:04:00,230
And I would say, let me copy.

57
00:04:00,980 --> 00:04:02,300
And here.

58
00:04:03,660 --> 00:04:06,090
Sux x refresh.

59
00:04:06,450 --> 00:04:11,850
And you can see that I have the creator of the comment and the name and then the date.

60
00:04:11,850 --> 00:04:13,740
And this is my comment.

61
00:04:13,980 --> 00:04:14,460
All right.

62
00:04:14,460 --> 00:04:21,899
So the next video let's go ahead and avoid by sending JSON data after a user has created a comment.

