From 2e6dee7047652399de608e4e8d32563828970cdc Mon Sep 17 00:00:00 2001 From: AllanCapistrano Date: Fri, 6 Oct 2023 08:53:34 -0300 Subject: [PATCH] chore: renaming message content to data --- endpoints/message.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/endpoints/message.go b/endpoints/message.go index d9e6487..d90fede 100644 --- a/endpoints/message.go +++ b/endpoints/message.go @@ -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. @@ -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)