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()
88// Increments or Decrements various counter
99//
1010// 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 ) => {
1912 const promises = [ ]
20- const result = snapshot . after . val ( )
13+ const result = snapshot . val ( )
2114
2215 // if result ref does not contain all required attributes we don't updated counters
2316 // e.g. due to some error when uploading from client
You can’t perform that action at this time.
0 commit comments