fix(dashboard): send public dashboard id on create (#9755)

This commit is contained in:
Vikrant Gupta
2025-12-02 19:57:10 +05:30
committed by GitHub
parent bc1295b93a
commit 81167c6947
2 changed files with 3 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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"),