From 8a0e7c2cb7b7e951154e089d5e27fd406e540974 Mon Sep 17 00:00:00 2001 From: Sinh Date: Mon, 16 Oct 2023 10:23:45 +0700 Subject: [PATCH 1/3] update parse response --- partnerapi/kiotviet/kiotviet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partnerapi/kiotviet/kiotviet.go b/partnerapi/kiotviet/kiotviet.go index 7730733..456859b 100644 --- a/partnerapi/kiotviet/kiotviet.go +++ b/partnerapi/kiotviet/kiotviet.go @@ -201,7 +201,7 @@ func (c *Client) UnregisterWebhook(req UnregisterWebhookReq) (*UnregisterWebhook return nil, fmt.Errorf("kiotviet.Client.UnregisterWebhook - requestHttpViaNats bad request %s", res.Body) } var data UnregisterWebhookRes - if err = r.ParseResponseData(&data); err != nil { + if err = r.ParseResponseData(&data.Success); err != nil { return nil, fmt.Errorf("kiotviet.Client.UnregisterWebhook - requestHttpViaNats parse response %v, %s", err, res.Body) } return &data, nil From efd91a81ddd99d717280c83d81bcfe21b782944b Mon Sep 17 00:00:00 2001 From: Sinh Date: Fri, 20 Oct 2023 16:12:29 +0700 Subject: [PATCH 2/3] update nats --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ef6a8b1..9fab0a3 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( git.selly.red/Selly-Modules/logger v0.0.2-0.20221010053254-567df039afdb - git.selly.red/Selly-Modules/natsio v1.0.3-0.20231006093940-b3bde5cd0960 + git.selly.red/Selly-Modules/natsio v1.0.3-0.20231020090841-5edec97ee393 github.com/nats-io/nats.go v1.17.0 github.com/thoas/go-funk v0.9.2 ) diff --git a/go.sum b/go.sum index 076c0ce..f20d753 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ git.selly.red/Selly-Modules/natsio v1.0.2-0.20221010041139-c11419a3ad33 h1:GvQje git.selly.red/Selly-Modules/natsio v1.0.2-0.20221010041139-c11419a3ad33/go.mod h1:KNODhfeBqxRmHHQHHU+p3JfH42t8s5aNxfgr6X8fr6g= git.selly.red/Selly-Modules/natsio v1.0.3-0.20231006093940-b3bde5cd0960 h1:wL/BW1xGoB/EXeA2HtxT6Nr/cXpPJYVNfToV3aFtGls= git.selly.red/Selly-Modules/natsio v1.0.3-0.20231006093940-b3bde5cd0960/go.mod h1:KNODhfeBqxRmHHQHHU+p3JfH42t8s5aNxfgr6X8fr6g= +git.selly.red/Selly-Modules/natsio v1.0.3-0.20231020090841-5edec97ee393 h1:43kE03FW3NONfE6hXlghafS1d233dfc7grlFqd+15SA= +git.selly.red/Selly-Modules/natsio v1.0.3-0.20231020090841-5edec97ee393/go.mod h1:KNODhfeBqxRmHHQHHU+p3JfH42t8s5aNxfgr6X8fr6g= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= From fb417551f424ea5139dfce4f330a9416e069e7e9 Mon Sep 17 00:00:00 2001 From: Sinh Date: Fri, 20 Oct 2023 16:15:14 +0700 Subject: [PATCH 3/3] change json tag --- partnerapi/kiotviet/model_req.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partnerapi/kiotviet/model_req.go b/partnerapi/kiotviet/model_req.go index 1fe10f1..30bca8b 100644 --- a/partnerapi/kiotviet/model_req.go +++ b/partnerapi/kiotviet/model_req.go @@ -48,7 +48,7 @@ type WebhookBody struct { type WebhookNotification struct { Action string `json:"Action"` - Data []WebhookStockUpdateData `json:"data"` + Data []WebhookStockUpdateData `json:"Data"` } type WebhookStockUpdateData struct {