From b74211c4e9a3bf86fa41175eab54417df0851220 Mon Sep 17 00:00:00 2001
From: Logan Hunt <loganhunt@simponic.xyz>
Date: Sun, 26 Jun 2022 15:29:04 -0700
Subject: YAY SLIDER FINALLY DONE HOLY SHIT

---
 src/routes/team/index.svelte | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

(limited to 'src/routes/team/index.svelte')

diff --git a/src/routes/team/index.svelte b/src/routes/team/index.svelte
index 489ae04..04c62b9 100644
--- a/src/routes/team/index.svelte
+++ b/src/routes/team/index.svelte
@@ -3,6 +3,7 @@
 
   import { onMount } from 'svelte';
   import { supabase } from '$lib/supabase';
+  import setImageUrl from '$lib/utils';
 
   const getPeople = async () => {
     const { data, error } = await supabase.from('people').select().order('id');
@@ -12,22 +13,9 @@
     return [];
   }
 
-  const mapImages = (people) => {
-    return people.map((x) => {
-      const { publicURL, error } = supabase
-        .storage
-        .from('mistymountains')
-        .getPublicUrl(x.image);
-      if (!error) {
-        return { ...x, image: publicURL };
-      }
-      return x;
-    });
-  }
-
   let people = [];
   onMount(async () => {
-    people = await getPeople().then(mapImages);
+    people = await getPeople().then((people) => people.map(setImageUrl));
   });
 </script>
 
-- 
cgit v1.2.3-70-g09d2

