Skip to content

Commit

Permalink
add error handling on create
Browse files Browse the repository at this point in the history
  • Loading branch information
riahk committed Dec 16, 2020
1 parent 1806db7 commit 83206ed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
delete data.last_value;
delete data.last_value_row_json;

updateResource(update_id, data).then(result => {
if (!result) {
updateResource(update_id, data).then(response => {
if (!response) {
return;
}

Expand All @@ -593,6 +593,10 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
} else if (currentAlert) {
// Create
createResource(data).then(response => {
if (!response) {
return;
}

if (onAdd) {
onAdd(response);
}
Expand Down

0 comments on commit 83206ed

Please sign in to comment.