Skip to content

Commit

Permalink
Fix issue #1523 (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtstern authored Jul 30, 2019
1 parent 936a15d commit 0dbfc9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Allow passing `GOOGLE_APPLICATION_CREDENTIALS` environment variable into the functions emulator.
* Set FIREBASE_DATABASE_EMULATOR_HOST in emulators:exec.
* Add upsert API for function triggers to the database emulator.
* Fix a bug where only one RTDB function could be registered by using the RTDB emulator upsert API to register functions triggers.
16 changes: 7 additions & 9 deletions src/emulator/functionsEmulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,12 @@ You can probably fix this by running "npm install ${
return Promise.reject();
}

const bundle = JSON.stringify([
{
name: `projects/${projectId}/locations/_/functions/${definition.name}`,
path: result[1], // path stored in the first capture group
event: definition.eventTrigger.eventType,
topic: `projects/${projectId}/topics/${definition.name}`,
},
]);
const bundle = JSON.stringify({
name: `projects/${projectId}/locations/_/functions/${definition.name}`,
path: result[1], // path stored in the first capture group
event: definition.eventTrigger.eventType,
topic: `projects/${projectId}/topics/${definition.name}`,
});

logger.debug(`addDatabaseTrigger`, JSON.stringify(bundle));
return new Promise<boolean>((resolve, reject) => {
Expand All @@ -611,7 +609,7 @@ You can probably fix this by running "npm install ${
}'`
);
}
request.put(
request.post(
setTriggersPath,
{
auth: {
Expand Down

0 comments on commit 0dbfc9b

Please sign in to comment.