Skip to content

Commit

Permalink
onDelete & onUpdate testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jfocco committed Jun 4, 2020
1 parent 551ad86 commit d56a7b0
Show file tree
Hide file tree
Showing 7 changed files with 872 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@
"paths": ["src"]
}
}
},
"env": {
"mocha": true
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ yarn-debug.log*
yarn-error.log*

.firebase

# service account key
serviceAccountKey.json
2 changes: 1 addition & 1 deletion functions/db/users/onDelete.function.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const functions = require('firebase-functions');
const admin = require('firebase-admin');

export default functions.database
module.exports = functions.database
.ref('users/{uid}')
.onDelete((snapshot, context) => {
const { uid } = context.params;
Expand Down
2 changes: 1 addition & 1 deletion functions/db/users/onUpdate.function.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const functions = require('firebase-functions');
const admin = require('firebase-admin');

export default functions.database
module.exports = functions.database
.ref('/users/{uid}')
.onUpdate((change, context) => {
const before = change.before.val();
Expand Down
Loading

0 comments on commit d56a7b0

Please sign in to comment.