Skip to content

Commit

Permalink
Changed errored to failed
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndsiWilliams committed Apr 7, 2022
1 parent 87f4cac commit b61afd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
alreadyExists,
passwordsNeeded,
loading: importLoading,
errored: importErrored,
failed: importErrored,
},
importResource,
} = useImportResource('database', t('database'), msg => {
Expand Down
10 changes: 5 additions & 5 deletions superset-frontend/src/views/CRUD/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ interface ImportResourceState {
loading: boolean;
passwordsNeeded: string[];
alreadyExists: string[];
errored: boolean;
failed: boolean;
}

export function useImportResource(
Expand All @@ -393,7 +393,7 @@ export function useImportResource(
loading: false,
passwordsNeeded: [],
alreadyExists: [],
errored: false,
failed: false,
});

function updateState(update: Partial<ImportResourceState>) {
Expand All @@ -409,7 +409,7 @@ export function useImportResource(
// Set loading state
updateState({
loading: true,
errored: false,
failed: false,
});

const formData = new FormData();
Expand Down Expand Up @@ -437,14 +437,14 @@ export function useImportResource(
updateState({
passwordsNeeded: [],
alreadyExists: [],
errored: false,
failed: false,
});
return true;
})
.catch(response =>
getClientErrorObject(response).then(error => {
updateState({
errored: true,
failed: true,
});
if (!error.errors) {
handleErrorMsg(
Expand Down

0 comments on commit b61afd4

Please sign in to comment.