From 2afc55eb5f25b50d2535f0a26172c04696029694 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Wed, 23 Mar 2022 10:24:37 +0700 Subject: [PATCH] fix --- appier.go | 3 +-- pull.go | 9 ++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/appier.go b/appier.go index 3dc67c6..7803c90 100644 --- a/appier.go +++ b/appier.go @@ -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 } diff --git a/pull.go b/pull.go index 8c7e593..6ddc657 100644 --- a/pull.go +++ b/pull.go @@ -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) }