From fdce2b50393ff08cf7cd02206aed9ecfb4be56aa Mon Sep 17 00:00:00 2001 From: euxzy Date: Sun, 14 Dec 2025 00:03:19 +0700 Subject: [PATCH] fix(organizer): fix profile image volunteer --- app/components/sections/organizers/organizers.tsx | 4 ++-- app/lib/utils.ts | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/components/sections/organizers/organizers.tsx b/app/components/sections/organizers/organizers.tsx index fa5ace8..e03e50f 100644 --- a/app/components/sections/organizers/organizers.tsx +++ b/app/components/sections/organizers/organizers.tsx @@ -5,7 +5,7 @@ import { OurTeamCard, type OurTeamCardProps, } from "~/components/shared/card/our-team"; -import { cn, parseOrganizerImage } from "~/lib/utils"; +import { cn, parseOrganizerImage, parseVolunteerImage } from "~/lib/utils"; interface OrganizersSectionProps { organizers: OrganizerPublicType[]; @@ -86,7 +86,7 @@ export const OrganizersSection = ({ id: volunteerItem.id, name: getFullName(volunteerItem), email: volunteerItem?.user?.email || undefined, - profile_picture: parseOrganizerImage({ id: volunteerItem.id }), + profile_picture: parseVolunteerImage({ id: volunteerItem.id }), twitter_username: (volunteerItem?.user?.twitter_username && `https://twitter.com/${volunteerItem?.user?.twitter_username}`) || diff --git a/app/lib/utils.ts b/app/lib/utils.ts index 1416b71..13f4e11 100644 --- a/app/lib/utils.ts +++ b/app/lib/utils.ts @@ -31,6 +31,12 @@ export const parseOrganizerImage = ({ id }: { id: string }) => { return `${url}/organizer/${id}/profile-picture`; }; +export const parseVolunteerImage = ({ id }: { id: string }) => { + if (!id) return ""; + const url = import.meta.env.VITE_BASE_API; + return `${url}/volunteer/${id}/profile-picture/`; +}; + export const onAvatarError = ( evt: React.SyntheticEvent, ) => {