mirror of
https://github.com/hexastack/hexabot
synced 2025-05-12 08:30:51 +00:00
fix: url built with buildUrl
This commit is contained in:
parent
cdf8461312
commit
36cd3179d8
@ -16,6 +16,7 @@ import { ReactNode } from "react";
|
|||||||
import { ROUTES } from "@/services/api.class";
|
import { ROUTES } from "@/services/api.class";
|
||||||
import { EntityType } from "@/services/types";
|
import { EntityType } from "@/services/types";
|
||||||
import { IMessage, IMessageFull } from "@/types/message.types";
|
import { IMessage, IMessageFull } from "@/types/message.types";
|
||||||
|
import { buildURL } from "@/utils/URL";
|
||||||
|
|
||||||
import { AttachmentViewer } from "../components/AttachmentViewer";
|
import { AttachmentViewer } from "../components/AttachmentViewer";
|
||||||
import { Carousel } from "../components/Carousel";
|
import { Carousel } from "../components/Carousel";
|
||||||
@ -134,10 +135,7 @@ export function getAvatarSrc(
|
|||||||
entity: EntityType.USER | EntityType.SUBSCRIBER,
|
entity: EntityType.USER | EntityType.SUBSCRIBER,
|
||||||
id?: string,
|
id?: string,
|
||||||
) {
|
) {
|
||||||
//remove trailing slash
|
return buildURL(apiUrl, `${ROUTES[entity]}/${id || "bot"}/profile_pic`);
|
||||||
return `${String(apiUrl).replace(/\/$/, "")}${ROUTES[entity]}/${
|
|
||||||
id || "bot"
|
|
||||||
}/profile_pic`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMessagePosition(
|
export function getMessagePosition(
|
||||||
|
Loading…
Reference in New Issue
Block a user