Skip to content

Commit b435762

Browse files
author
Ido Shamun
committed
fix: pubsub publish message failure
Due to recent update of @google-cloud/pubsub library, there was a breaking change that was not covered here.
1 parent 7a4005d commit b435762

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/publications.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const pubsubTopic = pubsub.topic('pub-request');
1717

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

2323
return Promise.resolve();

0 commit comments

Comments
 (0)