Skip to content

Commit

Permalink
stream results
Browse files Browse the repository at this point in the history
  • Loading branch information
xerosanyam committed Jun 4, 2024
1 parent a9945c3 commit 09d828f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/routes/(protected)/record/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export async function load({ locals }) {
redirect(302, ROUTES.LOGIN)
}

const addForm = await superValidate(zod(cardAddSchema));
const cards = await getCardsOrderByCreated(locals.user.id)
const addForm = superValidate(zod(cardAddSchema));
const cards = getCardsOrderByCreated(locals.user.id)

return {
addForm,
Expand Down
9 changes: 7 additions & 2 deletions src/routes/(protected)/record/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
export let data;
</script>

<AddNewCard formData={data.addForm} />
<NewCards cards={data.cards} />
{#await data.addForm then value}
<AddNewCard formData={value} />
{/await}

{#await data.cards then value}
<NewCards cards={value} />
{/await}

0 comments on commit 09d828f

Please sign in to comment.