mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-07 12:37:46 +00:00
added delete all
This commit is contained in:
16
src/lib/components/FileManagement/DeleteAllButton.svelte
Normal file
16
src/lib/components/FileManagement/DeleteAllButton.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user