Skip to content

Commit

Permalink
Responding with json
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Jan 20, 2025
1 parent efc8c3a commit ec752aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controllers/v1/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,13 @@ func (r *Repos) NewStream(c echo.Context) error {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Errorf("NewStream: failed to insert stream endpoint: %w", err))
}

return c.JSON(http.StatusCreated, endpoint.EndpointID)
endpointCreated := struct {
EndpointID int `db:"endpointId"`
}{
EndpointID: endpoint.EndpointID,
}

return c.JSON(http.StatusCreated, endpointCreated)
}

// UpdateStream updates an existing position
Expand Down

0 comments on commit ec752aa

Please sign in to comment.