From the course: Firebase Essential Training
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
The Submit Review function - Google Cloud Tutorial
From the course: Firebase Essential Training
The Submit Review function
- [Instructor] Okay, the next cloud function that we're going to write is a cloud function for submitting reviews. Now, if we were really releasing this application, we'd only want users to be able to submit reviews for restaurants that they've already been to. We don't want some user to just be able to write a bunch of reviews willy-nilly for any restaurant. However, for simplicity's sake, we're going to skip that logic for now. It's fairly easy to implement, and I'm sure that you'll have the skills after this course to do so if you really want to. One thing that we will be implementing, however, is that we want our submit review cloud function to recalculate the average rating for a restaurant every time a user submits a new review. I'll talk a little bit more about why we want to do this in a few minutes. First, let's get started by creating our new function. We'll call it SubmitReview.JS, and we're going to create it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Control access with Cloud Functions1m 42s
-
(Locked)
Set up to run functions locally7m
-
(Locked)
Run Cloud Functions2m 55s
-
(Locked)
The Make a Reservation function, part 18m 44s
-
(Locked)
The Make a Reservation function, part 25m 12s
-
(Locked)
The Submit Review function11m 37s
-
(Locked)
The Cancel Reservation function7m 17s
-
(Locked)
The Get Recommendations function6m 55s
-
(Locked)
The Search Restaurants function6m 20s
-
-
-
-
-