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>