cloud-functions-emulator icon indicating copy to clipboard operation
cloud-functions-emulator copied to clipboard

Unable to pass event params to the function.

Open viggy28 opened this issue 7 years ago • 0 comments

Hello,

I am having issues in passing the params to the function. Tried to pass the value for postid

info: Function crashed info: ReferenceError: postid is not defined at exports.test.functions.database.ref.onDelete (~/cloudFunctions/test-local/functions/index.js:12:22)

Environment details

OS: macOS Sierra 10.12.3 Node.js version: 8.9.1 npm version: 5.5.1 version: Don't know how to find that.

Steps to reproduce

const functions = require('firebase-functions');

exports.test = functions.database.ref('/posts/{postid}').onDelete((event) => { console.log("test value"); console.log("postId",postid); });

Deploy the function and invoke it as below. test('somedata', {params: {postid: 123}});

Following these steps will guarantee the quickest resolution possible.

Thanks!

viggy28 avatar Nov 25 '17 19:11 viggy28