summaryrefslogtreecommitdiff
path: root/src/lib/utils/setImageUrl.ts
blob: d2db853eb5756c9d1740ea69ddb17506efcd4049 (plain)
1
2
3
4
5
6
7
8
9
10
11
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;
};