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/modules/dashboard"
|
||||||
"github.com/SigNoz/signoz/pkg/querier"
|
"github.com/SigNoz/signoz/pkg/querier"
|
||||||
"github.com/SigNoz/signoz/pkg/transition"
|
"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/authtypes"
|
||||||
"github.com/SigNoz/signoz/pkg/types/ctxtypes"
|
"github.com/SigNoz/signoz/pkg/types/ctxtypes"
|
||||||
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
|
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
|
||||||
@@ -244,7 +245,7 @@ func (handler *handler) CreatePublic(rw http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
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) {
|
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)
|
admin_token = get_token(USER_ADMIN_EMAIL, USER_ADMIN_PASSWORD)
|
||||||
|
|
||||||
# Get domains which should be an empty list
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
signoz.self.host_configs["8080"].get("/api/v1/dashboards"),
|
signoz.self.host_configs["8080"].get("/api/v1/dashboards"),
|
||||||
json={
|
json={
|
||||||
@@ -54,6 +53,7 @@ def test_create_and_get_public_dashboard(
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == HTTPStatus.CREATED
|
assert response.status_code == HTTPStatus.CREATED
|
||||||
|
assert "id" in response.json()["data"]
|
||||||
|
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
signoz.self.host_configs["8080"].get(f"/api/v1/dashboards/{id}/public"),
|
signoz.self.host_configs["8080"].get(f"/api/v1/dashboards/{id}/public"),
|
||||||
|
|||||||
Reference in New Issue
Block a user