From 84d08872382bc7d2102998b795300d79fd905c15 Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Sat, 30 Jul 2022 17:31:25 -0500 Subject: Downloading `csv` file now also displays lab faculty info --- src/components/Labs.svelte | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/components/Labs.svelte') diff --git a/src/components/Labs.svelte b/src/components/Labs.svelte index 4df2184..51e0f8a 100644 --- a/src/components/Labs.svelte +++ b/src/components/Labs.svelte @@ -20,7 +20,6 @@ $: pts = [...$ptStore.values()]; - // TODO Make this more efficient rather than checking each PT per each Lab $: labsAndPts = [...$labStore.values()].flatMap((lab) => { return [ { @@ -49,11 +48,10 @@ let csv = cols.join(",") + "\n"; labsAndPts.forEach((row) => { let l = row.lab; - csv += `${l.course},${l.section},${l.time},${l.location},${ - row.pt?.name ?? "UNASSIGNED" - }\n`; + csv += `${l.course},${l.section},${l.time},${l.location},${displayFaculty( + l + )},${row.pt?.name ?? "UNASSIGNED"}\n`; }); - console.log(csv); const blob = new Blob([csv], { type: "text/csv" }); const anchor = document.createElement("a"); -- cgit v1.2.3