Skip to content

Commit

Permalink
fix password error filter
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Jun 25, 2021
1 parent df46a25 commit d9b743d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions superset-frontend/src/views/CRUD/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,13 @@ export function useDatabaseValidation() {
if (typeof e.json === 'function') {
e.json().then(({ errors = [] }: JsonObject) => {
const parsedErrors = errors
.filter(
(error: { error_type: string }) =>
error.error_type !==
'CONNECTION_MISSING_PARAMETERS_ERROR' || onCreate,
)
.filter((error: { error_type: string }) => {
const skipValidationError = ![
'CONNECTION_MISSING_PARAMETERS_ERROR',
'CONNECTION_ACCESS_DENIED_ERROR',
].includes(error.error_type);
return skipValidationError || onCreate;
})
.reduce(
(
obj: {},
Expand Down

0 comments on commit d9b743d

Please sign in to comment.