Apply new eslint rules; default to prettier for styling

This commit is contained in:
DaneEveritt 2022-06-26 15:13:52 -04:00
parent f22cce8881
commit dc84af9937
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
218 changed files with 3876 additions and 3564 deletions

View file

@ -14,10 +14,10 @@ interface Props {
}
const DeleteAllocationButton = ({ allocation }: Props) => {
const [ confirm, setConfirm ] = useState(false);
const [confirm, setConfirm] = useState(false);
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
const setServerFromState = ServerContext.useStoreActions(actions => actions.server.setServerFromState);
const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);
const setServerFromState = ServerContext.useStoreActions((actions) => actions.server.setServerFromState);
const { mutate } = getServerAllocations();
const { clearFlashes, clearAndAddHttpError } = useFlashKey('server:network');
@ -25,14 +25,13 @@ const DeleteAllocationButton = ({ allocation }: Props) => {
const deleteAllocation = () => {
clearFlashes();
mutate(data => data?.filter(a => a.id !== allocation), false);
setServerFromState(s => ({ ...s, allocations: s.allocations.filter(a => a.id !== allocation) }));
mutate((data) => data?.filter((a) => a.id !== allocation), false);
setServerFromState((s) => ({ ...s, allocations: s.allocations.filter((a) => a.id !== allocation) }));
deleteServerAllocation(uuid, allocation)
.catch(error => {
clearAndAddHttpError(error);
mutate();
});
deleteServerAllocation(uuid, allocation).catch((error) => {
clearAndAddHttpError(error);
mutate();
});
};
return (
@ -53,7 +52,7 @@ const DeleteAllocationButton = ({ allocation }: Props) => {
type={'button'}
onClick={() => setConfirm(true)}
>
<Icon icon={faTrashAlt} css={tw`w-3 h-auto`}/>
<Icon icon={faTrashAlt} css={tw`w-3 h-auto`} />
</Button.Danger>
</>
);