feat: function toggle support

This commit is contained in:
Timothy J. Baek
2024-06-23 18:34:42 -07:00
parent 3034f3d310
commit d8c112d8b0
8 changed files with 338 additions and 209 deletions
@@ -13,7 +13,8 @@
deleteFunctionById,
exportFunctions,
getFunctionById,
getFunctions
getFunctions,
toggleFunctionById
} from '$lib/apis/functions';
import ArrowDownTray from '../icons/ArrowDownTray.svelte';
@@ -224,7 +225,12 @@
</FunctionMenu>
<div class=" self-center mx-1">
<Switch />
<Switch
bind:state={func.is_active}
on:change={(e) => {
toggleFunctionById(localStorage.token, func.id);
}}
/>
</div>
</div>
</div>