Skip to content

Commit

Permalink
Repair setState passing to function without lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanPospisil committed Sep 23, 2022
1 parent f9f9d6e commit 6df22d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/components/execution-environment/repository-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { Paths, formatPath } from 'src/paths';
import {
errorMessage,
ErrorMessagesType,
mapErrorMessages,
isFieldValid,
setError,
mapErrorsAndSet,
Expand Down Expand Up @@ -472,14 +471,16 @@ export class RepositoryForm extends React.Component<IProps, IState> {
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));
});
}
Expand Down
1 change: 0 additions & 1 deletion src/utilities/map-error-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
});
}

0 comments on commit 6df22d0

Please sign in to comment.