From 90c009e09ea228e79181494bc7dba36ff03ebe44 Mon Sep 17 00:00:00 2001 From: Victor Edwin Reyes Date: Tue, 13 Aug 2024 14:34:14 +0800 Subject: [PATCH 1/2] fix: process selected in each lab accordion to filter by lab_id --- app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte b/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte index 6554c09..ba924f9 100644 --- a/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte +++ b/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte @@ -13,6 +13,7 @@ // eslint-disable-next-line init-declarations export let selected: TaggedStudentsWithLabs; + $: selected = selected.filter(val => val.lab_id === lab.lab_id); $: preferred = available.filter(val => val.labs[round - 1] === lab.lab_id); $: interested = available.filter(val => val.labs.slice(round).includes(lab.lab_id)); From 611e98f90e2b5fd7fb629dd3a01b43f9f23dcf47 Mon Sep 17 00:00:00 2001 From: Victor Edwin Reyes Date: Tue, 13 Aug 2024 14:37:52 +0800 Subject: [PATCH 2/2] fix: check if labs are less than quota instead of not equal to quota for lab ui --- app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte b/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte index ba924f9..e3325ae 100644 --- a/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte +++ b/app/src/routes/dashboard/(admin)/drafts/LabAccordionItem.svelte @@ -24,7 +24,7 @@
{#if lab.quota === 0}
{lab.lab_name}
- {:else if selected.length !== lab.quota} + {:else if selected.length < lab.quota}
{lab.lab_name}
{:else}
{lab.lab_name}