From c26cc2d263b133bcbb631641e75fb6f7a5ef52b1 Mon Sep 17 00:00:00 2001 From: Nulo Date: Fri, 29 Dec 2023 16:25:52 -0300 Subject: [PATCH] arreglar types en frontend --- frontend/src/lib/fetch.ts | 4 ++-- frontend/src/lib/routes/Dataset.svelte | 3 ++- frontend/src/lib/routes/Portal.svelte | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/fetch.ts b/frontend/src/lib/fetch.ts index ae2f5b0..dd946d0 100644 --- a/frontend/src/lib/fetch.ts +++ b/frontend/src/lib/fetch.ts @@ -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; } diff --git a/frontend/src/lib/routes/Dataset.svelte b/frontend/src/lib/routes/Dataset.svelte index e721769..280a13f 100644 --- a/frontend/src/lib/routes/Dataset.svelte +++ b/frontend/src/lib/routes/Dataset.svelte @@ -13,7 +13,6 @@ $: data = Promise.all([fetchData(url), fetchErrors(url)]) .then(([data, errors]) => ({ data, errors })) - .catch(alert);
@@ -102,6 +101,8 @@ {/each} {/if} + {:catch error} + Hubo un error intenando cargar este dataset archivado.
{error}
{/await}
diff --git a/frontend/src/lib/routes/Portal.svelte b/frontend/src/lib/routes/Portal.svelte index 3198108..cef4811 100644 --- a/frontend/src/lib/routes/Portal.svelte +++ b/frontend/src/lib/routes/Portal.svelte @@ -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://"))