summaryrefslogtreecommitdiff
path: root/src/lib/utils.ts
blob: 5586b47069519596f1a835711e530259b5e1f2c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { supabase } from './supabase';

const setImageUrl = (imageSpec) => {
  const { publicURL, error } = supabase
    .storage
    .from('mistymountains')
    .getPublicUrl(imageSpec.image);
  if (!error) {
    return { ...imageSpec, image: publicURL };
  }
  return imageSpec;
}

export default setImageUrl;