mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-06 04:20:29 +00:00
Update Upload.svelte
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { openApiStore } from '$lib';
|
||||
import { db } from '$lib/db';
|
||||
import { db, selectedSpec } from '$lib/db';
|
||||
import type { OpenAPIV3_1 } from '$lib/openAPITypes';
|
||||
import {
|
||||
FileButton,
|
||||
@@ -30,6 +30,10 @@
|
||||
content = parse(result);
|
||||
}
|
||||
openApiStore.set(content);
|
||||
selectedSpec.set({
|
||||
name: file.name,
|
||||
spec: content
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Error parsing ${isJson ? 'json' : 'yaml'} file`, error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user