Skip to content

Commit f3f8f61

Browse files
fix(minimal-webhook): Use response.status instead of response.statusCode
The native fetch API returns a Response object that has a 'status' property, not a 'statusCode' property. This commit fixes the error in the minimal-webhook function by using the correct property.
1 parent f7c222d commit f3f8f61

File tree

1 file changed

+1
-1
lines changed
  • Node-1st-gen/minimal-webhook/functions

1 file changed

+1
-1
lines changed

Node-1st-gen/minimal-webhook/functions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports.webhook = functions.database.ref('/hooks/{hookId}').onCreate(async (snap
3232
});
3333

3434
if (!response.ok) {
35-
throw new Error(`HTTP Error: ${response.statusCode}`);
35+
throw new Error(`HTTP Error: ${response.status}`);
3636
}
3737
functions.logger.log('SUCCESS! Posted', snap.ref);
3838
});

0 commit comments

Comments
 (0)