File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,9 @@ admin.initializeApp()
8
8
// Increments or Decrements various counter
9
9
//
10
10
// Gets triggered when new results of the group are written to the database.
11
- exports . counter = functions . database . ref ( '/v2/results/{projectId}/{groupId}/{userId}/' ) . onWrite ( ( snapshot , context ) => {
12
- // if result ref does not contain any data
13
- // (e.g. when deletion during transfer_results() occured)
14
- // do nothing
15
- if ( ! snapshot . after . exists ( ) ) {
16
- return null
17
- }
18
-
11
+ exports . counter = functions . database . ref ( '/v2/results/{projectId}/{groupId}/{userId}/' ) . onCreate ( ( snapshot , context ) => {
19
12
const promises = [ ]
20
- const result = snapshot . after . val ( )
13
+ const result = snapshot . val ( )
21
14
22
15
// if result ref does not contain all required attributes we don't updated counters
23
16
// e.g. due to some error when uploading from client
You can’t perform that action at this time.
0 commit comments