Skip to content

Commit

Permalink
fix: pubsub publish message failure
Browse files Browse the repository at this point in the history
Due to recent update of @google-cloud/pubsub library, there was a breaking change that was not covered here.
  • Loading branch information
Ido Shamun committed Apr 26, 2020
1 parent 7a4005d commit b435762
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/publications.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const pubsubTopic = pubsub.topic('pub-request');

const notifyPubRequest = (type, req) => {
if (config.env === 'production') {
return pubsubTopic.publisher().publish(Buffer.from(JSON.stringify({ type, pubRequest: req })));
return pubsubTopic.publishJSON({ type, pubRequest: req });
}

return Promise.resolve();
Expand Down

0 comments on commit b435762

Please sign in to comment.