Skip to content

Commit

Permalink
Fix media urls
Browse files Browse the repository at this point in the history
  • Loading branch information
barbara-chaves committed Mar 14, 2024
1 parent 7f0c6e8 commit 626e5f1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/src/lib/image-src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// import env from '@/env.mjs';
import env from '@/env.mjs';

export const getImageSrc = (url?: string) => url || '';
export const getImageSrc = (url?: string) => {
if (!url) return '';
if (url.includes('http')) {
return url;
}
return `${env.NEXT_PUBLIC_API_URL}${url}`;
};

0 comments on commit 626e5f1

Please sign in to comment.