Skip to content

Commit

Permalink
fix: cli message send and reader topic
Browse files Browse the repository at this point in the history
Signed-off-by: Arvindh <arvindh91@gmail.com>
  • Loading branch information
arvindh123 committed Jul 26, 2023
1 parent 2b78902 commit ed23945
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sdk/go/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (sdk mfSDK) SendMessage(chanName, msg, key string) errors.SDKError {
subtopicPart = fmt.Sprintf("/%s", strings.Replace(chanNameParts[1], ".", "/", -1))
}

url := fmt.Sprintf("%s/channels/%s/messages/%s", sdk.httpAdapterURL, chanID, subtopicPart)
url := fmt.Sprintf("%s/channels/%s/messages%s", sdk.httpAdapterURL, chanID, subtopicPart)

_, _, err := sdk.processRequest(http.MethodPost, url, ThingPrefix+key, string(CTJSON), []byte(msg), http.StatusAccepted)

Expand All @@ -34,7 +34,7 @@ func (sdk mfSDK) ReadMessages(chanName, token string) (MessagesPage, errors.SDKE
chanID := chanNameParts[0]
subtopicPart := ""
if len(chanNameParts) == channelParts {
subtopicPart = fmt.Sprintf("?subtopic=%s", strings.Replace(chanNameParts[1], ".", "/", -1))
subtopicPart = fmt.Sprintf("?subtopic=%s", chanNameParts[1])

Check warning on line 37 in pkg/sdk/go/message.go

View check run for this annotation

Codecov / codecov/patch

pkg/sdk/go/message.go#L37

Added line #L37 was not covered by tests
}

url := fmt.Sprintf("%s/channels/%s/messages%s", sdk.readerURL, chanID, subtopicPart)
Expand Down

0 comments on commit ed23945

Please sign in to comment.