refactor(chalice): changed dashboard-card's payload
refactor(chalice): removed endpoint to force UI to use the correct one
This commit is contained in:
parent
09c98b5bde
commit
c35ace3544
2 changed files with 7 additions and 2 deletions
|
|
@ -220,9 +220,9 @@ def get_card_chart(projectId: int, metric_id: int, data: schemas.CardSessionsSch
|
||||||
|
|
||||||
|
|
||||||
@app.post("/{projectId}/dashboards/{dashboardId}/cards/{metric_id}/chart", tags=["card"])
|
@app.post("/{projectId}/dashboards/{dashboardId}/cards/{metric_id}/chart", tags=["card"])
|
||||||
@app.post("/{projectId}/dashboards/{dashboardId}/cards/{metric_id}", tags=["card"])
|
# @app.post("/{projectId}/dashboards/{dashboardId}/cards/{metric_id}", tags=["card"])
|
||||||
def get_card_chart_for_dashboard(projectId: int, dashboardId: int, metric_id: int,
|
def get_card_chart_for_dashboard(projectId: int, dashboardId: int, metric_id: int,
|
||||||
data: schemas.CardSessionsSchema = Body(...),
|
data: schemas.SavedCardSchema = Body(...),
|
||||||
context: schemas.CurrentContext = Depends(OR_context)):
|
context: schemas.CurrentContext = Depends(OR_context)):
|
||||||
data = custom_metrics.make_chart_from_card(
|
data = custom_metrics.make_chart_from_card(
|
||||||
project=context.project, user_id=context.user_id, metric_id=metric_id, data=data, for_dashboard=True
|
project=context.project, user_id=context.user_id, metric_id=metric_id, data=data, for_dashboard=True
|
||||||
|
|
|
||||||
|
|
@ -1117,6 +1117,11 @@ class CardSessionsSchema(_TimedSchema, _PaginatedSchema):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
class SavedCardSchema(CardSessionsSchema):
|
||||||
|
metric_type: Optional[MetricType] = Field(default=None)
|
||||||
|
metric_of: Optional[Any] = Field(default=None)
|
||||||
|
|
||||||
|
|
||||||
class CardConfigSchema(BaseModel):
|
class CardConfigSchema(BaseModel):
|
||||||
col: Optional[int] = Field(default=None)
|
col: Optional[int] = Field(default=None)
|
||||||
row: Optional[int] = Field(default=2)
|
row: Optional[int] = Field(default=2)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue