From the course: Firebase Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The Make a Reservation function, part 1

The Make a Reservation function, part 1 - Google Cloud Tutorial

From the course: Firebase Essential Training

Start my 1-month free trial

The Make a Reservation function, part 1

- The first situation we're going to look at is creating a cloud function to make sure users can only make reservations in a restaurant's open time slots. Now obviously we can't just give users the ability to make these changes directly to the Firestore as we did when we implemented the edit profile page, since the situation requires a little more logic to make sure users are only making permitted changes. So let's go to our function source directory and create a new directory in there called reservations. And then inside there, we're going to create a file called make reservation.JS and we're going to start off by importing the regular things. So import star as functions from Firebase functions and import star as admin from Firebase admin and then we're going to say export const make reservation, and this function is going to be an HTTPS triggered function, but we're going to do something a little different here than…

Contents