mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-06 20:47:46 +00:00
feat: added full indexeddb support
This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { openApiStore } from '$lib';
|
||||
import { db, selectedSpec } from '$lib/db';
|
||||
|
||||
function onSave(e: Event): void {
|
||||
console.log('Save button clicked');
|
||||
if (!$selectedSpec) {
|
||||
$selectedSpec = {
|
||||
name: 'New OpenAPI Spec',
|
||||
spec: $openApiStore
|
||||
};
|
||||
}
|
||||
console.log($selectedSpec);
|
||||
const newSpec = structuredClone($selectedSpec);
|
||||
newSpec.id = undefined;
|
||||
db.apiSpecs.put(newSpec);
|
||||
}
|
||||
</script>
|
||||
|
||||
<button class="btn variant-ghost-success" on:click={onSave}> Save New </button>
|
||||
<button class="btn variant-ghost-success" on:click={onSave}> Save As </button>
|
||||
|
||||
Reference in New Issue
Block a user