2022-09-20 04:52:01 +00:00
|
|
|
export const buildPortalURL = portalSlug => {
|
|
|
|
const { hostURL, helpCenterURL } = window.chatwootConfig;
|
|
|
|
const baseURL = helpCenterURL || hostURL || '';
|
|
|
|
return `${baseURL}/hc/${portalSlug}`;
|
|
|
|
};
|
|
|
|
|
2022-09-21 01:23:28 +00:00
|
|
|
export const buildPortalArticleURL = (
|
|
|
|
portalSlug,
|
|
|
|
categorySlug,
|
|
|
|
locale,
|
|
|
|
articleId
|
|
|
|
) => {
|
2022-09-20 04:52:01 +00:00
|
|
|
const portalURL = buildPortalURL(portalSlug);
|
2022-09-21 01:23:28 +00:00
|
|
|
return `${portalURL}/${locale}/${categorySlug}/${articleId}`;
|
2022-09-20 04:52:01 +00:00
|
|
|
};
|