diff --git a/cmd/internal/models/models.go b/cmd/internal/models/models.go index 9c87f8b..810c094 100644 --- a/cmd/internal/models/models.go +++ b/cmd/internal/models/models.go @@ -17,6 +17,7 @@ type Config struct { } type HTTPResponse struct { + Status int `json:"status"` Success bool `json:"success"` Error string `json:"error,omitempty"` Timestamp string `json:"timestamp"` diff --git a/cmd/utils/utils.go b/cmd/utils/utils.go index fbfc0d9..f14f194 100644 --- a/cmd/utils/utils.go +++ b/cmd/utils/utils.go @@ -53,6 +53,7 @@ func WriteJSONResponse(w http.ResponseWriter, statusCode int, res models.HTTPRes w.Header().Set("Content-Type", "application/json") w.WriteHeader(statusCode) + res.Status = statusCode res.Timestamp = time.Now().UTC().Format(time.RFC3339) json.NewEncoder(w).Encode(res)