feat(chalice): fixed update alerts
This commit is contained in:
parent
9c6cb3c23d
commit
e5cf98362e
2 changed files with 4 additions and 1 deletions
|
|
@ -283,6 +283,7 @@ def custom_alert_to_front(values):
|
|||
# to support frontend format for payload
|
||||
if values.get("seriesId") is not None and values["query"]["left"] == schemas.AlertColumn.custom:
|
||||
values["query"]["left"] = values["seriesId"]
|
||||
values["seriesId"] = None
|
||||
return values
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -363,9 +363,11 @@ class AlertSchema(BaseModel):
|
|||
|
||||
@root_validator(pre=True)
|
||||
def transform_alert(cls, values):
|
||||
if values.get("seriesId") is None and isinstance(values["query"]["left"], int):
|
||||
if isinstance(values["query"]["left"], int):
|
||||
values["seriesId"] = values["query"]["left"]
|
||||
values["query"]["left"] = AlertColumn.custom
|
||||
else:
|
||||
values["seriesId"] = None
|
||||
|
||||
return values
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue