diff --git a/frontend/src/components/inbox/helpers/mapMessages.tsx b/frontend/src/components/inbox/helpers/mapMessages.tsx index 4a35697c..a46a63a7 100644 --- a/frontend/src/components/inbox/helpers/mapMessages.tsx +++ b/frontend/src/components/inbox/helpers/mapMessages.tsx @@ -16,6 +16,7 @@ import { ReactNode } from "react"; import { ROUTES } from "@/services/api.class"; import { EntityType } from "@/services/types"; import { IMessage, IMessageFull } from "@/types/message.types"; +import { buildURL } from "@/utils/URL"; import { AttachmentViewer } from "../components/AttachmentViewer"; import { Carousel } from "../components/Carousel"; @@ -134,10 +135,7 @@ export function getAvatarSrc( entity: EntityType.USER | EntityType.SUBSCRIBER, id?: string, ) { - //remove trailing slash - return `${String(apiUrl).replace(/\/$/, "")}${ROUTES[entity]}/${ - id || "bot" - }/profile_pic`; + return buildURL(apiUrl, `${ROUTES[entity]}/${id || "bot"}/profile_pic`); } export function getMessagePosition(