Skip to content

Commit

Permalink
chore: renaming message content to data
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanCapistrano committed Oct 6, 2023
1 parent 1994c04 commit 2e6dee7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions endpoints/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
)

type Message struct {
Index string `json:"index"`
Content interface{} `json:"content"`
Index string `json:"index"`
Data interface{} `json:"data"`
}

// Get all messages using a specific index.
Expand Down Expand Up @@ -86,7 +86,7 @@ func CreateNewMessage(writer http.ResponseWriter, request *http.Request) {
json.Unmarshal(requestBody, &message)

// Serializar o objeto para formato JSON
jsonContent, err := json.Marshal(message.Content)
jsonContent, err := json.Marshal(message.Data)
if err != nil {
errorMessage := fmt.Sprintf("Error serializing the object: %s", err.Error())
jsonInString := fmt.Sprintf("{\"error\": \"%s\"}", errorMessage)
Expand Down

0 comments on commit 2e6dee7

Please sign in to comment.