mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix: [sc-54864] Adds safety check to provide near term fix to save query (#21034)
* [sc-54864] Adds safety check to provide near term fix for Queries not saving There is an error when casting the columns array to String() for saving queries where the objects in the array are missing the toString method. This is a near term rapid patch to fix workflow in production which will have a follow up to identify root cause. * fix typo Co-authored-by: Elizabeth Thompson <eschutho@gmail.com> * Adjusted chekc to be explicit for undefined instead of truthy This fixes issue caught by unit test where the if statement was using a truthy check where it should be explicitly checking for value of undefined * Adds new unit test to get 100% coverage for callApi Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
@@ -908,9 +908,12 @@ export function updateSavedQuery(query) {
|
||||
dispatch(addSuccessToast(t('Your query was updated')));
|
||||
dispatch(queryEditorSetTitle(query, query.name));
|
||||
})
|
||||
.catch(() =>
|
||||
dispatch(addDangerToast(t('Your query could not be updated'))),
|
||||
)
|
||||
.catch(e => {
|
||||
const message = t('Your query could not be updated');
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(message, e);
|
||||
dispatch(addDangerToast(message));
|
||||
})
|
||||
.then(() => dispatch(updateQueryEditor(query)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user