arreglar types en frontend

This commit is contained in:
Cat /dev/Nulo 2023-12-29 16:25:52 -03:00
parent e1d208b63c
commit c26cc2d263
3 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
import streamSaver from "streamsaver";
import { zData, type Distribution, zError, zDumpMetadata } from "common/schema";
import { zData, type Distribution, zDumpError, zDumpMetadata } from "common/schema";
export async function downloadFile(
dataPath: string,
@ -73,6 +73,6 @@ export async function fetchErrors(url: string) {
.split("\n")
.filter((line) => !!line)
.map((line) => JSON.parse(line))
.map((json) => zError.parse(json));
.map((json) => zDumpError.parse(json));
return lines;
}

View file

@ -13,7 +13,6 @@
$: data = Promise.all([fetchData(url), fetchErrors(url)])
.then(([data, errors]) => ({ data, errors }))
.catch(alert);
</script>
<main class="mx-auto max-w-3xl">
@ -102,6 +101,8 @@
{/each}
</ul>
{/if}
{:catch error}
Hubo un error intenando cargar este dataset archivado. <pre>{error}</pre>
{/await}
</Container>
</main>

View file

@ -13,7 +13,6 @@
$: data = Promise.all([fetchData(url), fetchErrors(url)])
.then(([data, errors]) => ({ data, errors }))
.catch(alert);
function arreglarHomepageUrl(url: string): string {
if (!url.startsWith("http://") && !url.startsWith("https://"))