Skip to content

Commit

Permalink
Enable auto table creation in Google Cloud Functions SendGrid tutorial (
Browse files Browse the repository at this point in the history
#266)

* Enable auto table creation

'autoCreate' is consumed in dataset.get and table.get is called with empty option.

* Add missing spaces
  • Loading branch information
fujimura authored and jmdobry committed Nov 29, 2016
1 parent 580c00e commit 4bb9f00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions functions/sendgrid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,9 @@ exports.sendgridWebhook = function sendgridWebhook (req, res) {
*/
function getTable () {
const dataset = bigquery.dataset(config.DATASET);
const options = { autoCreate: true };

return dataset.get(options)
.then(([dataset]) => dataset.table(config.TABLE).get(options));
return dataset.get({ autoCreate: true })
.then(([dataset]) => dataset.table(config.TABLE).get({ autoCreate: true }));
}
// [END functions_sendgrid_get_table]

Expand Down

0 comments on commit 4bb9f00

Please sign in to comment.