Skip to content

Commit

Permalink
fix: eventarc pubsub fix (#2020)
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
  • Loading branch information
grant authored Oct 26, 2020
1 parent d2d8435 commit e4502b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eventarc/pubsub/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// [START eventarc_pubsub_handler]
const express = require('express');
const {toMessagePublishedEvent} = require('@google/events/cloud/pubsub/v1/MessagePublishedData');
const {toMessagePublishedData} = require('@google/events/cloud/pubsub/v1/MessagePublishedData');
const app = express();

app.use(express.json());
Expand All @@ -32,7 +32,7 @@ app.post('/', (req, res) => {
return;
}
// Cast to MessagePublishedEvent for IDE autocompletion
const pubSubMessage = toMessagePublishedEvent(req.body);
const pubSubMessage = toMessagePublishedData(req.body);
const name = pubSubMessage.message && pubSubMessage.message.data
? Buffer.from(pubSubMessage.message.data, 'base64').toString().trim()
: 'World';
Expand Down

0 comments on commit e4502b9

Please sign in to comment.