mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-16 18:44:36 -06:00
fix(dashboard): send public dashboard id on create (#9755)
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/SigNoz/signoz/pkg/modules/dashboard"
|
||||
"github.com/SigNoz/signoz/pkg/querier"
|
||||
"github.com/SigNoz/signoz/pkg/transition"
|
||||
"github.com/SigNoz/signoz/pkg/types"
|
||||
"github.com/SigNoz/signoz/pkg/types/authtypes"
|
||||
"github.com/SigNoz/signoz/pkg/types/ctxtypes"
|
||||
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
|
||||
@@ -244,7 +245,7 @@ func (handler *handler) CreatePublic(rw http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
render.Success(rw, http.StatusCreated, nil)
|
||||
render.Success(rw, http.StatusCreated, types.Identifiable{ID: publicDashboard.ID})
|
||||
}
|
||||
|
||||
func (handler *handler) GetPublic(rw http.ResponseWriter, r *http.Request) {
|
||||
|
||||
@@ -26,7 +26,6 @@ def test_create_and_get_public_dashboard(
|
||||
):
|
||||
admin_token = get_token(USER_ADMIN_EMAIL, USER_ADMIN_PASSWORD)
|
||||
|
||||
# Get domains which should be an empty list
|
||||
response = requests.post(
|
||||
signoz.self.host_configs["8080"].get("/api/v1/dashboards"),
|
||||
json={
|
||||
@@ -54,6 +53,7 @@ def test_create_and_get_public_dashboard(
|
||||
)
|
||||
|
||||
assert response.status_code == HTTPStatus.CREATED
|
||||
assert "id" in response.json()["data"]
|
||||
|
||||
response = requests.get(
|
||||
signoz.self.host_configs["8080"].get(f"/api/v1/dashboards/{id}/public"),
|
||||
|
||||
Reference in New Issue
Block a user