Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: eventarc pubsub fix #2020

Merged
merged 4 commits into from
Oct 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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