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 Cancel Reservation function

The Cancel Reservation function - Google Cloud Tutorial

From the course: Firebase Essential Training

Start my 1-month free trial

The Cancel Reservation function

- [Instructor] The next cloud function we're going to implement is a cloud function for canceling reservations. This will be the function that gets called when the user clicks this cancel reservation button here. So this function is going to be pretty similar to what we've been seeing so far in this section. Let's start off by going into our functions directory and insert reservations directory, we're going to create a new file called cancel reservation dot JS. And then we're going to start off by importing things. Import star is functions from Firebase functions, import star as admin from Firebase admin and export const cancel reservation. And we're going to use functions that HTTPS dot on-call for this function as well. And it's going to have an async callback with data and context. Now, inside this function, we're going to have to do two main things. The first is that we're going to have to delete the actual…

Contents