Skip to content

Commit

Permalink
stream response
Browse files Browse the repository at this point in the history
  • Loading branch information
xerosanyam committed Jun 6, 2024
1 parent a8983e3 commit a4dc697
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/routes/(protected)/revise/+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 reviewForm = await superValidate(zod(cardReviewSchema));
const cards = await getCardsOrderByNextPractice(locals.user.id)
const reviewForm = superValidate(zod(cardReviewSchema));
const cards = getCardsOrderByNextPractice(locals.user.id)

return {
reviewForm,
Expand Down
6 changes: 5 additions & 1 deletion src/routes/(protected)/revise/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
export let data;
</script>

<ReviseCards cards={data.cards} data={data.reviewForm} />
{#await data.cards then cards}
{#await data.reviewForm then reviewForm}
<ReviseCards {cards} data={reviewForm} />
{/await}
{/await}

0 comments on commit a4dc697

Please sign in to comment.