Skip to content

Commit 4eb988c

Browse files
committed
address comments
1 parent 6274e3a commit 4eb988c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

2nd-gen/uppercase/functions/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
// [START import]
2020
// The Cloud Functions for Firebase SDK to create v2 Cloud Functions and setup triggers.
2121
const { onRequest } = require('firebase-functions/v2/https');
22-
const { onRefCreated } = require('firebase-functions/v2/database');
22+
const { onValueCreated } = require('firebase-functions/v2/database');
2323
const { logger } = require('firebase-functions');
2424

2525
// The Firebase Admin SDK to access the Firebase Realtime Database.
2626
const admin = require('firebase-admin');
2727
admin.initializeApp();
2828
// [END import]
2929

30-
// [START addMessage]
30+
// [START addmessage]
3131
// Take the text parameter passed to this HTTP endpoint and insert it into the
3232
// Realtime Database under the path /messages/:pushId/original
3333
// [START addMessageTrigger]
34-
exports.addMessage = onRequest(async (req, resp) => {
34+
exports.addmessage = onRequest(async (req, resp) => {
3535
// [END addMessageTrigger]
3636
// Grab the text parameter.
3737
const original = req.query.text;
@@ -42,13 +42,13 @@ exports.addMessage = onRequest(async (req, resp) => {
4242
res.redirect(303, snapshot.ref.toString());
4343
// [END adminSdkPush]
4444
});
45-
// [END addMessage]
45+
// [END addmessage]
4646

47-
// [START makeUppercase]
47+
// [START makeuppercase]
4848
// Listens for new messages added to /messages/:pushId/original and creates an
4949
// uppercase version of the message to /messages/:pushId/uppercase
5050
// for all databases in 'us-central1'
51-
exports.makeUppercase = onRefCreated('/messages/{pushId}/original', (event) => {
51+
exports.makeuppercase = onValueCreated('/messages/{pushId}/original', (event) => {
5252
// Grab the current value of what was written to the Realtime Database.
5353
const original = event.data.val();
5454
logger.log('Uppercasing', event.params.pushId, original);
@@ -58,5 +58,5 @@ exports.makeUppercase = onRefCreated('/messages/{pushId}/original', (event) => {
5858
// Setting an "uppercase" sibling in the Realtime Database returns a Promise.
5959
return event.data.ref.parent.child('uppercase').set(uppercase);
6060
});
61-
// [END makeUppercase]
61+
// [END makeuppercase]
6262
// [END all]

2nd-gen/uppercase/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"main": "index.js",
1616
"dependencies": {
1717
"firebase-admin": "^10.0.2",
18-
"firebase-functions": "^4.0.0"
18+
"firebase-functions": "^3.22.0"
1919
},
2020
"devDependencies": {
2121
"eslint": "^8.9.0",

0 commit comments

Comments
 (0)