mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-06 04:20:29 +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>
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user