summaryrefslogtreecommitdiff
path: root/src/lib/utils/setImageUrl.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-01-07 01:21:06 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-01-07 01:21:06 -0700
commitdb671d26c43e47b8285d319a0fd758df60d729c7 (patch)
tree4cfc7e7b719d246637818e83feb8981255c19c67 /src/lib/utils/setImageUrl.ts
parente1905622d7d8657aa7cd5bdfe9d06e4fbe40dc70 (diff)
downloadmistymountainstherapy-db671d26c43e47b8285d319a0fd758df60d729c7.tar.gz
mistymountainstherapy-db671d26c43e47b8285d319a0fd758df60d729c7.zip
initial update with nodemailer
Diffstat (limited to 'src/lib/utils/setImageUrl.ts')
-rw-r--r--src/lib/utils/setImageUrl.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/utils/setImageUrl.ts b/src/lib/utils/setImageUrl.ts
new file mode 100644
index 0000000..15566a8
--- /dev/null
+++ b/src/lib/utils/setImageUrl.ts
@@ -0,0 +1,12 @@
+import { supabase } from '../supabase';
+
+export const setImageUrl = (imageSpec) => {
+ const { publicURL, error } = supabase
+ .storage
+ .from('mistymountains')
+ .getPublicUrl(imageSpec.image);
+ if (!error) {
+ return { ...imageSpec, image: publicURL };
+ }
+ return imageSpec;
+}