adding API_BASE url to avatar URL to fetch it properly
This commit is contained in:
@@ -30,7 +30,12 @@ export function ArticleMeta({
|
|||||||
<Avatar
|
<Avatar
|
||||||
key={index}
|
key={index}
|
||||||
alt={author.name}
|
alt={author.name}
|
||||||
src={author.avatar}
|
src={
|
||||||
|
(import.meta.env.VITE_API_BASE_URL.replace(/\/+$/, "") +
|
||||||
|
"/" +
|
||||||
|
(author.avatar?.replace(/^\/+/, "") || "")
|
||||||
|
)
|
||||||
|
}
|
||||||
sx={{ width: 24, height: 24 }}
|
sx={{ width: 24, height: 24 }}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -122,7 +122,12 @@ export default function Profile({ onBack }: ProfileProps) {
|
|||||||
|
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 3 }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 3 }}>
|
||||||
<Avatar
|
<Avatar
|
||||||
src={formData.avatar}
|
src={
|
||||||
|
(import.meta.env.VITE_API_BASE_URL.replace(/\/+$/, "") +
|
||||||
|
"/" +
|
||||||
|
(formData.avatar?.replace(/^\/+/, "") || "")
|
||||||
|
)
|
||||||
|
}
|
||||||
alt={formData.name || formData.username}
|
alt={formData.name || formData.username}
|
||||||
sx={{ width: 64, height: 64 }}
|
sx={{ width: 64, height: 64 }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user