From 6df22d09edf43eb81fe5e8659f8f46f769a8b2a4 Mon Sep 17 00:00:00 2001 From: Milan Pospisil Date: Fri, 23 Sep 2022 10:16:07 +0200 Subject: [PATCH] Repair setState passing to function without lambda --- src/components/execution-environment/repository-form.tsx | 9 +++++---- src/utilities/map-error-messages.ts | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/execution-environment/repository-form.tsx b/src/components/execution-environment/repository-form.tsx index 43a3172234..4a04ac537e 100644 --- a/src/components/execution-environment/repository-form.tsx +++ b/src/components/execution-environment/repository-form.tsx @@ -31,7 +31,6 @@ import { Paths, formatPath } from 'src/paths'; import { errorMessage, ErrorMessagesType, - mapErrorMessages, isFieldValid, setError, mapErrorsAndSet, @@ -472,14 +471,16 @@ export class RepositoryForm extends React.Component { include_tags, exclude_tags, }).catch((err) => { - mapErrorsAndSet(this.state, this.setState, err); - const { status, statusText } = err.response; + /*const { status, statusText } = err.response; const errorTitle = t`Name already exists.`; this.addAlert({ variant: 'danger', title: errorTitle, description: errorMessage(status, statusText), - }); + });*/ + + mapErrorsAndSet(this.state, (state) => this.setState(state), err); + return Promise.reject(new Error(err)); }); } diff --git a/src/utilities/map-error-messages.ts b/src/utilities/map-error-messages.ts index 8abda9d3a7..1960f687af 100644 --- a/src/utilities/map-error-messages.ts +++ b/src/utilities/map-error-messages.ts @@ -64,7 +64,6 @@ export function mapErrorsAndSet(state, setState, err) { const errObj = mapErrorMessages(err); Object.keys(errObj).forEach((key) => { - debugger; setError(state, setState, key, errObj[key]); }); }