summaryrefslogtreecommitdiff
path: root/src/routes/team
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-06-26 15:29:04 -0700
committerLogan Hunt <loganhunt@simponic.xyz>2022-06-26 15:29:04 -0700
commitb74211c4e9a3bf86fa41175eab54417df0851220 (patch)
tree089e89389b3ebe8f77518f488d100031b2405b40 /src/routes/team
parent17df5367f994cf18fb80df018218dc13b79a7b4f (diff)
downloadmistymountainstherapy-b74211c4e9a3bf86fa41175eab54417df0851220.tar.gz
mistymountainstherapy-b74211c4e9a3bf86fa41175eab54417df0851220.zip
YAY SLIDER FINALLY DONE HOLY SHIT
Diffstat (limited to 'src/routes/team')
-rw-r--r--src/routes/team/index.svelte16
1 files changed, 2 insertions, 14 deletions
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>