added delete all

This commit is contained in:
Luke Hagar
2024-05-29 13:19:48 -07:00
parent ff5b0a5685
commit 595e0f9195
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<script lang="ts">
import { newSpec } from '$lib';
import { db, setSpec, type APISpec } from '$lib/db';
</script>
<button
class="btn variant-ghost-error"
on:click={async () => {
if (confirm(`Are you sure you want to delete all saved specs?`)) {
db.apiSpecs.clear();
setSpec(newSpec);
}
}}
>
Delete All
</button>

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import CreateNewButton from '$lib/components/FileManagement/CreateNewButton.svelte';
import DeleteAllButton from '$lib/components/FileManagement/DeleteAllButton.svelte';
import DeleteButton from '$lib/components/FileManagement/DeleteButton.svelte';
import LoadButton from '$lib/components/FileManagement/LoadButton.svelte';
import SaveButton from '$lib/components/FileManagement/SaveButton.svelte';
@@ -56,6 +57,7 @@
<SaveNewButton />
<CreateNewButton />
<Upload />
<DeleteAllButton />
</div>
<!-- <div class="w-full h-full flex flex-col items-center justify-center grow">
<h1 class="h1">