Unwrap log response (#1232)

Currently, the log response is not compatible with the swagger
document.

This change removes the log wrapper that the old version required.
This commit is contained in:
Tom Coupland
2018-09-20 11:51:26 +01:00
committed by GitHub
parent 56b426ed42
commit 4aeba35d17

View File

@@ -27,11 +27,10 @@ type callLog struct {
func writeJSON(c *gin.Context, callID string, logReader io.Reader) { func writeJSON(c *gin.Context, callID string, logReader io.Reader) {
var b bytes.Buffer var b bytes.Buffer
b.ReadFrom(logReader) b.ReadFrom(logReader)
c.JSON(http.StatusOK, callLogResponse{"Successfully loaded log", c.JSON(http.StatusOK, &callLog{
&callLog{ CallID: callID,
CallID: callID, Log: b.String(),
Log: b.String(), })
}})
} }
func (s *Server) handleCallLogGet(c *gin.Context) { func (s *Server) handleCallLogGet(c *gin.Context) {