getAvatarUrl and getMediaUrl were byte-identical bucket URL builders in two separate files. getAvatarUrl is now a re-export of getMediaUrl — all ~34 call sites keep working unchanged. AvatarUpload, MultiImageUpload, and VideoUploadForm each duplicated the same XHR PUT-with-progress Promise wrapper. The three flows differ too much (single vs. multi-file, with/without a confirm step) for a single useFileUpload hook to be a clean fit, so only the truly identical piece — the XHR PUT itself — was extracted into uploadFileWithProgress().
9 lines
312 B
TypeScript
9 lines
312 B
TypeScript
import { getMediaUrl } from "@/lib/media-url";
|
|
|
|
/**
|
|
* Constructs the public CDN URL for a pet avatar stored in Supabase Storage.
|
|
* Identical bucket/path scheme to getMediaUrl — kept as a separate export
|
|
* for call-site readability (avatar vs. post/story media).
|
|
*/
|
|
export const getAvatarUrl = getMediaUrl;
|