fix(indexes): toggle on and off with switch (#1164)

* chore(indexers): replace array position with id

* fix(indexers): enable and disable without editing

* feat(indexer): add toggle endpoint and refactoring

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
Fabricio Silva 2023-10-03 20:57:11 +01:00 committed by GitHub
parent 603191b47d
commit 8600d3a2ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 167 additions and 50 deletions

View file

@ -263,7 +263,7 @@ const ListItem = ({ network, expanded }: ListItemProps) => {
/>
<div className="col-span-2 md:col-span-1 flex pl-5 text-gray-500 dark:text-gray-400">
<Switch
onClick={(e: MouseEvent) => e.stopPropagation()}
onClick={(e) => e.stopPropagation()}
checked={network.enabled}
onChange={onToggleMutation}
className={classNames(
@ -478,7 +478,7 @@ const ListItemDropdown = ({
const restart = (id: number) => restartMutation.mutate(id);
return (
<Menu
<Menu
as="div"
onClick={(e: MouseEvent) => {
e.preventDefault();
@ -787,4 +787,3 @@ const IRCLogsDropdown = () => {
</Menu>
);
};