Skip to content

Commit 4bb9f00

Browse files
fujimurajmdobry
authored andcommitted
Enable auto table creation in Google Cloud Functions SendGrid tutorial (GoogleCloudPlatform#266)
* Enable auto table creation 'autoCreate' is consumed in dataset.get and table.get is called with empty option. * Add missing spaces
1 parent 580c00e commit 4bb9f00

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

functions/sendgrid/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,9 @@ exports.sendgridWebhook = function sendgridWebhook (req, res) {
271271
*/
272272
function getTable () {
273273
const dataset = bigquery.dataset(config.DATASET);
274-
const options = { autoCreate: true };
275274

276-
return dataset.get(options)
277-
.then(([dataset]) => dataset.table(config.TABLE).get(options));
275+
return dataset.get({ autoCreate: true })
276+
.then(([dataset]) => dataset.table(config.TABLE).get({ autoCreate: true }));
278277
}
279278
// [END functions_sendgrid_get_table]
280279

0 commit comments

Comments
 (0)