Skip to content

Commit

Permalink
[frontend] Linted
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonsai8863 committed May 6, 2024
1 parent abbd62a commit a54c779
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { FormikConfig } from 'formik/dist/types';
import Drawer, { DrawerVariant } from '@components/common/drawer/Drawer';
import useHelper from 'src/utils/hooks/useHelper';
import CreateEntityControlledDial from '@components/common/menus/CreateEntityControlledDial';
import useApiMutation from 'src/utils/hooks/useApiMutation';
import { handleErrorInForm } from '../../../../relay/environment';
import { useFormatter } from '../../../../components/i18n';
import TextField from '../../../../components/TextField';
Expand All @@ -25,7 +26,6 @@ import { ExternalReferencesLinesPaginationQuery$variables } from './__generated_
import type { Theme } from '../../../../components/Theme';
import { ExternalReferenceAddInput, ExternalReferenceCreationMutation, ExternalReferenceCreationMutation$data } from './__generated__/ExternalReferenceCreationMutation.graphql';
import CustomFileUploader from '../../common/files/CustomFileUploader';
import useApiMutation from 'src/utils/hooks/useApiMutation';

// Deprecated - https://mui.com/system/styles/basics/
// Do not use it for new code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ExternalReferencesField } from '../../common/form/ExternalReferencesFie
import ConfidenceField from '../../common/form/ConfidenceField';
import { useSchemaCreationValidation } from '../../../../utils/hooks/useEntitySettings';
import { Option } from '../../common/form/ReferenceField';
import { MESSAGING$, handleErrorInForm } from '../../../../relay/environment';
import { handleErrorInForm } from '../../../../relay/environment';
import useDefaultValues from '../../../../utils/hooks/useDefaultValues';
import CustomFileUploader from '../../common/files/CustomFileUploader';
import useApiMutation from '../../../../utils/hooks/useApiMutation';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Drawer, { DrawerVariant } from '@components/common/drawer/Drawer';
import useHelper from 'src/utils/hooks/useHelper';
import CreateEntityControlledDial from '@components/common/menus/CreateEntityControlledDial';
import { useFormatter } from '../../../../components/i18n';
import { MESSAGING$, handleErrorInForm } from '../../../../relay/environment';
import { handleErrorInForm } from '../../../../relay/environment';
import TextField from '../../../../components/TextField';
import ObjectMarkingField from '../../common/form/ObjectMarkingField';
import ObjectLabelField from '../../common/form/ObjectLabelField';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ const useApiMutation = <T extends MutationParameters>(
commit({
...args,
onError: (error: Error) => {
args.onError
? args.onError(error)
: relayErrorHandling(error) as UseMutationConfig<T>['onError'];
if (args.onError) args.onError(error);
else relayErrorHandling(error);
MESSAGING$.notifyError(options?.errorMessage
? options.errorMessage
: `${error}`
);
: `${error}`);
},
onCompleted: (response: T['response'], errors: PayloadError[] | null) => {
if (args.onCompleted) args.onCompleted(response, errors);
Expand Down

0 comments on commit a54c779

Please sign in to comment.