All language subtitles for 009 Creating and Getting Reviews_Downloadly.ir_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian Download
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:01,040 --> 00:00:02,140 So in this video, 2 00:00:02,140 --> 00:00:05,610 we're going to continue implementing the review's resource 3 00:00:05,610 --> 00:00:07,960 and this time by implementing an endpoint 4 00:00:07,960 --> 00:00:12,083 for getting all reviews and also for creating new reviews. 5 00:00:13,760 --> 00:00:16,970 And so at this point, we're basically just reviewing stuff 6 00:00:16,970 --> 00:00:20,040 that we already learned before in previous sections. 7 00:00:20,040 --> 00:00:23,230 And so in this video, I have another challenge for you. 8 00:00:23,230 --> 00:00:26,690 So basically, I want you to implement both these endpoints, 9 00:00:26,690 --> 00:00:28,720 so one endpoint for getting all review 10 00:00:28,720 --> 00:00:32,800 and one endpoint for creating new reviews all on your own. 11 00:00:32,800 --> 00:00:33,633 Okay? 12 00:00:33,633 --> 00:00:35,320 So create the controller file, 13 00:00:35,320 --> 00:00:37,970 then in there create the controller functions, 14 00:00:37,970 --> 00:00:42,390 and then also create the routes in your review routes file. 15 00:00:42,390 --> 00:00:45,550 And then by the end of course, create some new reviews 16 00:00:45,550 --> 00:00:48,040 and also retrieve them from the database 17 00:00:48,040 --> 00:00:50,090 using get all reviews. 18 00:00:50,090 --> 00:00:50,923 All right. 19 00:00:50,923 --> 00:00:54,103 So please pause the video now and get to work. 20 00:00:57,730 --> 00:00:58,563 All right. 21 00:00:58,563 --> 00:01:01,600 And now it's my turn to actually implement this, 22 00:01:01,600 --> 00:01:03,993 and I'm starting with the controller functions. 23 00:01:06,690 --> 00:01:08,370 So right here we create 24 00:01:13,000 --> 00:01:15,130 review Controller dot js 25 00:01:15,130 --> 00:01:19,403 then of course we start by requiring the review. 26 00:01:26,800 --> 00:01:31,253 So one level up, then models, then review model. 27 00:01:36,810 --> 00:01:39,860 So get All Reviews, and we're using 28 00:01:39,860 --> 00:01:42,030 the same name as always. 29 00:01:42,030 --> 00:01:43,430 Right? 30 00:01:43,430 --> 00:01:44,860 Then we already know this is going to be 31 00:01:44,860 --> 00:01:47,800 an async function because we're going to be dealing 32 00:01:47,800 --> 00:01:49,123 with the database here, 33 00:01:53,860 --> 00:01:57,270 and also we need to wrap this entire function 34 00:01:57,270 --> 00:01:59,293 into the catch Async. 35 00:02:02,160 --> 00:02:05,763 So catch Async, I think that's what it's called. 36 00:02:07,360 --> 00:02:08,312 Require. 37 00:02:16,970 --> 00:02:17,803 All right. 38 00:02:24,705 --> 00:02:29,288 And now let's simply fetch all the reviews using await, 39 00:02:30,830 --> 00:02:34,823 and then just a simple find without any filter. 40 00:02:37,520 --> 00:02:42,520 A status of 200 and then send back to normal JSON. 41 00:02:45,890 --> 00:02:47,830 Status as success. 42 00:02:47,830 --> 00:02:49,670 We also define the result property 43 00:02:49,670 --> 00:02:52,583 with the reviews dot length, 44 00:02:55,790 --> 00:02:58,373 and of course, then the data itself. 45 00:03:00,170 --> 00:03:04,053 Give it a save here and now onto the next one. 46 00:03:05,740 --> 00:03:08,790 So create Review. 47 00:03:08,790 --> 00:03:10,100 All right. 48 00:03:10,100 --> 00:03:12,120 And you start to seeing here that 49 00:03:12,120 --> 00:03:15,490 we're building a lot of duplicate code actually. 50 00:03:15,490 --> 00:03:17,690 So all of this here looks 51 00:03:17,690 --> 00:03:20,650 basically exactly the same as it looks for the users, 52 00:03:20,650 --> 00:03:21,810 and for the tours. 53 00:03:21,810 --> 00:03:22,800 Right? 54 00:03:22,800 --> 00:03:24,490 And actually we are going to fix this 55 00:03:24,490 --> 00:03:26,240 a bit later in the section. 56 00:03:26,240 --> 00:03:29,490 But for now, I really just want to make this work. 57 00:03:29,490 --> 00:03:30,323 Okay? 58 00:03:30,323 --> 00:03:33,130 So for now don't worry about writing all this 59 00:03:33,130 --> 00:03:34,793 kinda duplicate looking code. 60 00:03:40,170 --> 00:03:41,090 Okay. 61 00:03:41,090 --> 00:03:43,863 So we call this here new Review, 62 00:03:46,090 --> 00:03:51,090 and then as always we use dot create with all the data 63 00:03:52,040 --> 00:03:54,450 coming in from the body. 64 00:03:54,450 --> 00:03:55,283 Okay? 65 00:03:55,283 --> 00:03:58,220 And so, again if there are any fields on the body 66 00:03:58,220 --> 00:03:59,890 that are not in the review schema 67 00:03:59,890 --> 00:04:02,240 then they will simply be ignored. 68 00:04:02,240 --> 00:04:03,810 And so that's why it's safe to 69 00:04:03,810 --> 00:04:05,690 actually simply do it like this 70 00:04:05,690 --> 00:04:07,750 when creating a new resource. 71 00:04:07,750 --> 00:04:08,950 All right? 72 00:04:08,950 --> 00:04:11,853 Anyway, let's now send it back to the client as always. 73 00:04:13,380 --> 00:04:16,613 So with a status of 201 for created, 74 00:04:26,600 --> 00:04:30,260 and review should be the new 75 00:04:31,820 --> 00:04:33,090 Review. 76 00:04:33,090 --> 00:04:33,923 All right. 77 00:04:35,410 --> 00:04:39,970 Actually without the colon there, semicolon, and so yeah. 78 00:04:39,970 --> 00:04:41,630 These are all controllers. 79 00:04:41,630 --> 00:04:43,843 Now let's move on to the route. 80 00:04:46,240 --> 00:04:47,090 So review 81 00:04:48,750 --> 00:04:50,393 Routes dot js. 82 00:04:51,810 --> 00:04:53,210 And here of course we start 83 00:04:53,210 --> 00:04:55,693 by requiring our controller, 84 00:05:06,110 --> 00:05:08,220 and to the controllers and 85 00:05:08,220 --> 00:05:10,053 review Controller dot js. 86 00:05:12,900 --> 00:05:15,633 Next up, we need to create our router. 87 00:05:17,970 --> 00:05:21,800 So express, and so of course we also need to 88 00:05:21,800 --> 00:05:23,590 import express here. 89 00:05:23,590 --> 00:05:25,973 So let's do that before doing anything else. 90 00:05:32,510 --> 00:05:33,913 Express. 91 00:05:39,360 --> 00:05:42,523 So dot Router, and I think this is how it works. 92 00:05:44,350 --> 00:05:45,540 And now router 93 00:05:47,080 --> 00:05:48,770 and define our route 94 00:05:50,180 --> 00:05:54,430 and this again is basically route of the reviews. 95 00:05:54,430 --> 00:05:55,263 Okay. 96 00:05:55,263 --> 00:05:57,090 Because remember how in the next step 97 00:05:57,090 --> 00:05:58,600 we are actually going to mount 98 00:05:58,600 --> 00:06:01,700 this router on API slash reviews. 99 00:06:01,700 --> 00:06:02,533 Okay? 100 00:06:02,533 --> 00:06:05,920 So just like we did with the tours and the users. 101 00:06:05,920 --> 00:06:09,260 And actually let's do that before we do anything else. 102 00:06:09,260 --> 00:06:10,093 Okay? 103 00:06:10,093 --> 00:06:12,210 So just to take that confusion 104 00:06:12,210 --> 00:06:13,950 that you might have away. 105 00:06:13,950 --> 00:06:16,573 So, let's export the router from here. 106 00:06:21,516 --> 00:06:22,349 Okay? 107 00:06:22,349 --> 00:06:24,500 And so now we can move over 108 00:06:24,500 --> 00:06:26,063 to app dot js. 109 00:06:27,600 --> 00:06:30,290 And then of course import our router here. 110 00:06:37,571 --> 00:06:38,571 And require, 111 00:06:42,320 --> 00:06:44,210 review routes. 112 00:06:44,210 --> 00:06:45,170 Okay? 113 00:06:45,170 --> 00:06:47,790 And so now we come down here 114 00:06:47,790 --> 00:06:51,600 and mount this router on a new path. 115 00:06:51,600 --> 00:06:53,910 And that path is going to be as I said 116 00:06:53,910 --> 00:06:56,400 API slash V1 slash 117 00:06:57,790 --> 00:06:58,623 reviews. 118 00:06:59,740 --> 00:07:00,573 Okay. 119 00:07:00,573 --> 00:07:02,580 And so again this router here 120 00:07:02,580 --> 00:07:05,670 that we're specifying now is basically a middleware 121 00:07:05,670 --> 00:07:08,420 that we mount upon this path. 122 00:07:08,420 --> 00:07:09,253 Okay? 123 00:07:09,253 --> 00:07:10,770 So whenever there is a request 124 00:07:10,770 --> 00:07:13,650 with a url that starts like this 125 00:07:13,650 --> 00:07:15,430 then this middleware function here 126 00:07:15,430 --> 00:07:16,890 will basically be called. 127 00:07:16,890 --> 00:07:18,640 And so that is then our router 128 00:07:18,640 --> 00:07:20,910 and in there just the slash route, 129 00:07:20,910 --> 00:07:23,230 so just the root basically will 130 00:07:23,230 --> 00:07:26,510 then be this API V1 reviews. 131 00:07:26,510 --> 00:07:27,430 Okay? 132 00:07:27,430 --> 00:07:31,200 So just like we did it before we the other two resources. 133 00:07:31,200 --> 00:07:34,020 So tour Model, that's not where we were working. 134 00:07:34,020 --> 00:07:36,223 We were working in the review Routes. 135 00:07:37,190 --> 00:07:38,360 Okay. 136 00:07:38,360 --> 00:07:39,840 So we specified a route. 137 00:07:39,840 --> 00:07:42,240 Let's now specify the method 138 00:07:42,240 --> 00:07:44,283 for which we specify our function. 139 00:07:45,370 --> 00:07:48,240 So we have get, and for that we used 140 00:07:49,290 --> 00:07:50,950 or we actually rewrote 141 00:07:50,950 --> 00:07:55,440 review Controller dot get All Reviews 142 00:07:55,440 --> 00:07:56,273 Right? 143 00:07:56,273 --> 00:07:59,480 And then we also have post for 144 00:08:02,180 --> 00:08:04,370 create Review. 145 00:08:04,370 --> 00:08:05,203 Okay? 146 00:08:05,203 --> 00:08:06,420 Give it a save. 147 00:08:06,420 --> 00:08:08,940 And actually we only want authenticated users 148 00:08:08,940 --> 00:08:11,010 to be able to post reviews. 149 00:08:11,010 --> 00:08:14,960 And also only users that are actually regular users. 150 00:08:14,960 --> 00:08:18,210 So not administrators and also not tour guides. 151 00:08:18,210 --> 00:08:19,043 Okay? 152 00:08:19,043 --> 00:08:21,060 So how can we implement that? 153 00:08:21,060 --> 00:08:23,820 Let's remember our authentication section. 154 00:08:23,820 --> 00:08:26,913 So we start by requiring our auth Controller. 155 00:08:36,320 --> 00:08:39,860 So again, controllers and auth Controller. 156 00:08:39,860 --> 00:08:41,419 And now all we need to do 157 00:08:41,419 --> 00:08:43,450 is to actually use the middleware functions 158 00:08:43,450 --> 00:08:45,140 that we specified in there. 159 00:08:45,140 --> 00:08:46,280 Remember. 160 00:08:46,280 --> 00:08:50,640 So first, we use the protect middleware, 161 00:08:50,640 --> 00:08:51,950 so auth Controller 162 00:08:53,150 --> 00:08:54,400 dot protect 163 00:08:54,400 --> 00:08:57,260 and this will make it so that we protect this route 164 00:08:57,260 --> 00:09:00,520 to only be accessed by users who are authenticated. 165 00:09:00,520 --> 00:09:01,353 Right? 166 00:09:01,353 --> 00:09:02,697 And then in the next step we say 167 00:09:02,697 --> 00:09:05,170 that we want to restrict this route 168 00:09:06,020 --> 00:09:08,830 so we use our restrict To middleware 169 00:09:08,830 --> 00:09:12,273 to only users with the role of user. 170 00:09:14,100 --> 00:09:14,980 All right? 171 00:09:14,980 --> 00:09:18,070 So again, we did this here before a couple of times. 172 00:09:18,070 --> 00:09:21,680 And so, not really anything new at this point. 173 00:09:21,680 --> 00:09:22,513 Okay. 174 00:09:22,513 --> 00:09:24,490 So I think we followed all the steps. 175 00:09:24,490 --> 00:09:27,650 So first off, we have a model which will allow us 176 00:09:27,650 --> 00:09:29,420 to create new documents. 177 00:09:29,420 --> 00:09:31,430 Then we have our Controller functions 178 00:09:31,430 --> 00:09:34,550 defined in our Controller to get all reviews 179 00:09:34,550 --> 00:09:36,460 and to create reviews. 180 00:09:36,460 --> 00:09:38,820 Then, we used these Controller functions 181 00:09:38,820 --> 00:09:39,910 or handler functions 182 00:09:39,910 --> 00:09:41,370 as you can also call them, 183 00:09:41,370 --> 00:09:43,560 to create some new routes. 184 00:09:43,560 --> 00:09:44,393 Okay? 185 00:09:44,393 --> 00:09:46,500 And so we created a route for getting reviews 186 00:09:46,500 --> 00:09:48,000 and for posting reviews. 187 00:09:48,000 --> 00:09:49,690 And just like before we did this 188 00:09:49,690 --> 00:09:52,330 basically in a mini sub-application 189 00:09:52,330 --> 00:09:54,130 which is just for reviews. 190 00:09:54,130 --> 00:09:56,630 And so that's why we created our new router 191 00:09:56,630 --> 00:09:59,620 which then we imported into our main application 192 00:09:59,620 --> 00:10:02,660 and mounted it on this url where we want 193 00:10:02,660 --> 00:10:05,520 to access everything related to reviews. 194 00:10:05,520 --> 00:10:06,600 All right? 195 00:10:06,600 --> 00:10:09,793 So, let's now actually go ahead and test this. 196 00:10:12,910 --> 00:10:14,560 So I'm gonna go ahead, copy this, 197 00:10:15,860 --> 00:10:18,680 and create a new tab here 198 00:10:18,680 --> 00:10:19,620 and so here 199 00:10:20,720 --> 00:10:22,040 it's reviews 200 00:10:22,040 --> 00:10:24,113 and of course post. 201 00:10:25,580 --> 00:10:26,970 All right. 202 00:10:26,970 --> 00:10:29,080 So, what do we actually need to specify 203 00:10:29,080 --> 00:10:30,963 in order to post a new review? 204 00:10:34,090 --> 00:10:36,340 So we need the review itself. 205 00:10:36,340 --> 00:10:37,173 Remember. 206 00:10:40,550 --> 00:10:42,103 So let's say "amazing tour" 207 00:10:43,260 --> 00:10:44,770 then the rating 208 00:10:44,770 --> 00:10:46,470 and I'm gonna give it five here, 209 00:10:46,470 --> 00:10:48,883 and then the tour and the user ID. 210 00:10:53,890 --> 00:10:54,723 Okay? 211 00:10:54,723 --> 00:10:58,970 And so now we need to get the ID of one of the tours. 212 00:10:58,970 --> 00:10:59,803 Okay? 213 00:10:59,803 --> 00:11:02,670 And so let's use the first real tour here 214 00:11:02,670 --> 00:11:06,583 let's say, so let's use this sea explorer. 215 00:11:07,480 --> 00:11:08,313 All right? 216 00:11:09,380 --> 00:11:10,213 So, 217 00:11:12,500 --> 00:11:14,660 the ID of the sea explorer 218 00:11:14,660 --> 00:11:16,575 and now we of course also need 219 00:11:16,575 --> 00:11:20,080 the ID of the user posting the review. 220 00:11:20,080 --> 00:11:21,380 And we can get that here from 221 00:11:21,380 --> 00:11:23,130 get all users. 222 00:11:23,130 --> 00:11:25,640 And so actually we only have one user 223 00:11:25,640 --> 00:11:27,470 which is a regular user. 224 00:11:27,470 --> 00:11:31,303 So this Jonas here and so let's get this ID. 225 00:11:32,190 --> 00:11:33,370 All right? 226 00:11:33,370 --> 00:11:35,020 Now keep in mind that this user 227 00:11:35,020 --> 00:11:36,730 actually needs to be logged in. 228 00:11:36,730 --> 00:11:37,563 Okay? 229 00:11:37,563 --> 00:11:39,150 And so a bit later we will then actually 230 00:11:39,150 --> 00:11:42,180 automatically get the user ID from the user 231 00:11:42,180 --> 00:11:43,670 that's already logged in. 232 00:11:43,670 --> 00:11:46,980 Remember we can do that because the protect middleware 233 00:11:46,980 --> 00:11:49,790 will put the user on the request object. 234 00:11:49,790 --> 00:11:50,930 Remember that? 235 00:11:50,930 --> 00:11:53,640 But for now, I wanted to keep it simple here, 236 00:11:53,640 --> 00:11:55,220 and so with the current implementation 237 00:11:55,220 --> 00:11:58,800 we actually need to provide the user's ID as well. 238 00:11:58,800 --> 00:11:59,633 Okay? 239 00:11:59,633 --> 00:12:02,390 But still we need to log in as a regular user 240 00:12:02,390 --> 00:12:05,130 because we protected this route. 241 00:12:05,130 --> 00:12:06,490 Remember that? 242 00:12:06,490 --> 00:12:09,713 So let's just close a couple of these. 243 00:12:14,207 --> 00:12:15,040 Okay? 244 00:12:17,368 --> 00:12:18,701 And log in here. 245 00:12:19,630 --> 00:12:24,080 And we do that as, so what hello dot Jonas at IO 246 00:12:26,500 --> 00:12:27,430 so hello. 247 00:12:27,430 --> 00:12:29,850 And his password is probably and I hope 248 00:12:29,850 --> 00:12:31,053 it is still the same. 249 00:12:32,530 --> 00:12:36,430 And actually it's not so let's try a new password 250 00:12:36,430 --> 00:12:40,223 cause I remember I used that one when we changed passwords. 251 00:12:44,730 --> 00:12:47,240 Still doesn't work, and so let's actually 252 00:12:47,240 --> 00:12:48,530 create a new user. 253 00:12:48,530 --> 00:12:49,363 Okay? 254 00:12:49,363 --> 00:12:52,850 Of course we could do the reset password at this point, 255 00:12:52,850 --> 00:12:54,320 but that's a bit too much work 256 00:12:54,320 --> 00:12:56,760 and so I'm simply going to create a new user 257 00:12:56,760 --> 00:12:59,570 so that's easier just for testing it now. 258 00:12:59,570 --> 00:13:00,403 Okay? 259 00:13:02,330 --> 00:13:05,110 So let's use test at Jonas dot IO 260 00:13:05,110 --> 00:13:07,603 and the name here is gonna be test user. 261 00:13:10,810 --> 00:13:11,643 All right. 262 00:13:13,150 --> 00:13:16,790 Oh, and we already have that email address in our database 263 00:13:16,790 --> 00:13:17,740 and that's strange. 264 00:13:19,460 --> 00:13:20,413 We have user. 265 00:13:21,350 --> 00:13:24,190 Maybe it didn't, we didn't update this properly. 266 00:13:24,190 --> 00:13:27,130 Oh, but maybe it's a deleted user. 267 00:13:27,130 --> 00:13:29,380 So a user that's no longer active 268 00:13:29,380 --> 00:13:31,620 and is therefore not showing up here. 269 00:13:31,620 --> 00:13:34,750 So let's just take a look at that in compass. 270 00:13:34,750 --> 00:13:36,820 And of course when you're in development mode, 271 00:13:36,820 --> 00:13:40,730 you're gonna run into these kind of issues all the time. 272 00:13:40,730 --> 00:13:43,660 So here, test Jonas, and as I was saying, 273 00:13:43,660 --> 00:13:46,110 it's actually one of these deleted users. 274 00:13:46,110 --> 00:13:48,640 So active set to false. 275 00:13:48,640 --> 00:13:50,423 So let's try that again. 276 00:13:54,070 --> 00:13:56,663 So test user here simply as well. 277 00:13:57,710 --> 00:14:01,330 So send it now and now we are logged in. 278 00:14:01,330 --> 00:14:04,800 And so now I'm copying the ID from this new user 279 00:14:04,800 --> 00:14:06,493 to create this new review. 280 00:14:08,470 --> 00:14:09,570 All right? 281 00:14:09,570 --> 00:14:11,290 Let's send it now, 282 00:14:11,290 --> 00:14:14,580 and of course we get the you are not logged in error 283 00:14:14,580 --> 00:14:16,330 because we actually didn't provide 284 00:14:16,330 --> 00:14:18,590 our JSON web token. 285 00:14:18,590 --> 00:14:21,140 So we need to come to authorization 286 00:14:21,140 --> 00:14:22,920 then the bearer token, 287 00:14:22,920 --> 00:14:24,320 and then of course this one. 288 00:14:25,860 --> 00:14:27,863 So, if we try this now again, 289 00:14:29,690 --> 00:14:31,480 then here we go. 290 00:14:31,480 --> 00:14:32,313 Okay. 291 00:14:32,313 --> 00:14:34,653 Let's create another one for another tour, 292 00:14:35,930 --> 00:14:37,313 this time for, 293 00:14:39,370 --> 00:14:40,270 for the next one, 294 00:14:40,270 --> 00:14:42,560 so for Forrest Hiker. 295 00:14:42,560 --> 00:14:44,253 So copy the ID here as well. 296 00:14:46,490 --> 00:14:47,323 Yeah. 297 00:14:47,323 --> 00:14:50,693 Here the user is gonna be the same, but another tour. 298 00:14:51,590 --> 00:14:54,750 Let's give it a four stars. 299 00:14:54,750 --> 00:14:58,147 And let's just say "loved it." 300 00:14:59,490 --> 00:15:00,630 Something very simple 301 00:15:01,979 --> 00:15:02,812 and okay. 302 00:15:04,120 --> 00:15:05,570 Give this a save, 303 00:15:05,570 --> 00:15:07,260 and I'm gonna create 304 00:15:07,260 --> 00:15:09,290 a new folder here for the reviews 305 00:15:14,310 --> 00:15:15,143 and of course 306 00:15:16,690 --> 00:15:18,120 something went wrong here. 307 00:15:18,120 --> 00:15:19,920 So where is that folder? 308 00:15:19,920 --> 00:15:21,140 Mm. 309 00:15:21,140 --> 00:15:24,423 It's nowhere really so let's just create it here. 310 00:15:36,700 --> 00:15:39,323 And we can actually change the name up here as well. 311 00:15:40,520 --> 00:15:41,353 So create 312 00:15:43,790 --> 00:15:44,983 new review. 313 00:15:50,440 --> 00:15:51,400 Okay. 314 00:15:51,400 --> 00:15:54,543 And now we also want to get all reviews. 315 00:15:58,300 --> 00:16:00,503 So we no longer need these two. 316 00:16:05,190 --> 00:16:07,720 Okay and this one is really a GET, 317 00:16:07,720 --> 00:16:10,723 and let's also save it in Reviews. 318 00:16:17,870 --> 00:16:19,220 Get all the reviews. 319 00:16:19,220 --> 00:16:22,210 And so that should be enough to get us started 320 00:16:22,210 --> 00:16:24,660 and really see all our reviews. 321 00:16:24,660 --> 00:16:26,860 Okay, and here we go. 322 00:16:26,860 --> 00:16:29,350 Let's take a look at compass, 323 00:16:29,350 --> 00:16:31,810 and to see the reviews here we need to go ahead 324 00:16:31,810 --> 00:16:33,870 and reload the entire database, 325 00:16:33,870 --> 00:16:37,130 but now when we come to Reviews here we indeed see 326 00:16:37,130 --> 00:16:40,593 our two reviews that have been created as well. 327 00:16:42,030 --> 00:16:43,150 Okay. 328 00:16:43,150 --> 00:16:45,040 Now how do we make it so that 329 00:16:45,040 --> 00:16:48,000 we actually see the user and the tour data here 330 00:16:48,000 --> 00:16:50,480 instead of simply the IDs? 331 00:16:50,480 --> 00:16:54,190 Well, of course we need to again use populate. 332 00:16:54,190 --> 00:16:55,050 Right? 333 00:16:55,050 --> 00:16:57,070 And so that's exactly what we're going to do 334 00:16:57,070 --> 00:16:58,253 in the next video. 23241

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.