Merge pull request #5 from Selly-Modules/develop

fix
This commit is contained in:
Minh Nguyen 2022-03-23 10:25:08 +07:00 committed by GitHub
commit eb9a169aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -41,10 +41,9 @@ func NewClient(config Config) (*Client, error) {
// publishWithJetStream ...
func publishWithJetStream(streamName, subject string, data []byte) (isPublished bool, err error) {
var req = RequestBody{Body: data}
// Publish jet stream
if err = client.natsJetStream.Publish(streamName, subject, toBytes(req)); err != nil {
if err = client.natsJetStream.Publish(streamName, subject, data); err != nil {
return
}

View File

@ -4,11 +4,6 @@ package appier
type Pull struct{}
// ProductUpsert ...
func (Pull) ProductUpsert(payload Payload) (bool, error) {
return publishWithJetStream(JetStreamAppierService, SubjectPullProductUpsert, payload.Data)
}
// PingService ...
func (Pull) PingService(payload Payload) (bool, error) {
return publishWithJetStream(JetStreamAppierService, SubjectPingPullService, payload.Data)
func (Pull) ProductUpsert(payload []byte) (bool, error) {
return publishWithJetStream(JetStreamAppierService, SubjectPullProductUpsert, payload)
}