Skip to content

Commit dfd7ce5

Browse files
CarolineDenisgithub-actions[bot]
authored andcommitted
Lint code with ESLint and Prettier
Triggered by 4396b60 on branch refs/heads/issue-6213-1
1 parent 4396b60 commit dfd7ce5

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

specifyweb/frontend/js_src/lib/components/Toolbar/SystemConfigTool.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import React from 'react';
33
import { useBooleanState } from '../../hooks/useBooleanState';
44
import { commonText } from '../../localization/common';
55
import { userText } from '../../localization/user';
6+
import { ajax } from '../../utils/ajax';
67
import { type RA, localized } from '../../utils/types';
78
import { Container, H2, H3, Ul } from '../Atoms';
89
import { Button } from '../Atoms/Button';
910
import type { SpecifyResource } from '../DataModel/legacyTypes';
11+
import { serializeResource } from '../DataModel/serializers';
1012
import { tables } from '../DataModel/tables';
1113
import type { Collection, Discipline, Division } from '../DataModel/types';
1214
import { collection } from '../FormParse/webOnlyViews';
1315
import { ResourceView } from '../Forms/ResourceView';
1416
import { load } from '../InitialContext';
1517
import { Dialog, LoadingScreen } from '../Molecules/Dialog';
16-
import { ajax } from '../../utils/ajax';
17-
import { serializeResource } from '../DataModel/serializers';
1818

1919
export function SystemConfigurationTool(): JSX.Element | null {
2020
const [allInfo, setAllInfo] = React.useState<InstitutionData | null>(null);
@@ -23,10 +23,7 @@ export function SystemConfigurationTool(): JSX.Element | null {
2323
useBooleanState();
2424

2525
const [newResource, setNewResource] = React.useState<
26-
| SpecifyResource<Collection>
27-
| SpecifyResource<Division>
28-
| SpecifyResource<Discipline>
29-
| undefined
26+
SpecifyResource<Collection> | SpecifyResource<Discipline> | SpecifyResource<Division> | undefined
3027
>();
3128

3229
React.useEffect(() => {
@@ -56,7 +53,7 @@ export function SystemConfigurationTool(): JSX.Element | null {
5653
},
5754
body: data,
5855
})
59-
.then(() => fetchAllSystemData)
56+
.then(async () => fetchAllSystemData)
6057
.then(setAllInfo)
6158
.then(() => closeNewResource());
6259
};
@@ -79,7 +76,7 @@ export function SystemConfigurationTool(): JSX.Element | null {
7976
`'Add new division to institution' ${institution.id}`
8077
);
8178
setNewResource(
82-
new tables.Division.Resource() as SpecifyResource<Collection>
79+
new tables.Division.Resource()
8380
);
8481
handleNewResource();
8582
}}
@@ -100,7 +97,7 @@ export function SystemConfigurationTool(): JSX.Element | null {
10097
setNewResource(
10198
new tables.Discipline.Resource({
10299
division: `/api/specify/discipline/${division.id}/`,
103-
}) as SpecifyResource<Discipline>
100+
})
104101
);
105102
handleNewResource();
106103
}}
@@ -122,7 +119,7 @@ export function SystemConfigurationTool(): JSX.Element | null {
122119
setNewResource(
123120
new tables.Collection.Resource({
124121
discipline: `/api/specify/discipline/${discipline.id}/`,
125-
}) as SpecifyResource<Collection>
122+
})
126123
);
127124
handleNewResource();
128125
}}

0 commit comments

Comments
 (0)