mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 20:18:08 +00:00
fix: Add missing 'hc' path segment after custom domain in article URLs (#11353)
This commit is contained in:
@@ -19,7 +19,7 @@ const getDefaultBaseURL = () => {
|
|||||||
throw new Error('No valid base URL found in configuration');
|
throw new Error('No valid base URL found in configuration');
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${baseURL}/hc`;
|
return baseURL;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,7 +39,7 @@ const getPortalBaseURL = customDomain =>
|
|||||||
*/
|
*/
|
||||||
export const buildPortalURL = (portalSlug, customDomain) => {
|
export const buildPortalURL = (portalSlug, customDomain) => {
|
||||||
const baseURL = getPortalBaseURL(customDomain);
|
const baseURL = getPortalBaseURL(customDomain);
|
||||||
return `${baseURL}/${portalSlug}`;
|
return `${baseURL}/hc/${portalSlug}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const buildPortalArticleURL = (
|
export const buildPortalArticleURL = (
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ describe('PortalHelper', () => {
|
|||||||
'article-slug',
|
'article-slug',
|
||||||
'custom-domain.dev'
|
'custom-domain.dev'
|
||||||
)
|
)
|
||||||
).toEqual('https://custom-domain.dev/handbook/articles/article-slug');
|
).toEqual('https://custom-domain.dev/hc/handbook/articles/article-slug');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles https in custom domain correctly', () => {
|
it('handles https in custom domain correctly', () => {
|
||||||
@@ -55,7 +55,7 @@ describe('PortalHelper', () => {
|
|||||||
'article-slug',
|
'article-slug',
|
||||||
'https://custom-domain.dev'
|
'https://custom-domain.dev'
|
||||||
)
|
)
|
||||||
).toEqual('https://custom-domain.dev/handbook/articles/article-slug');
|
).toEqual('https://custom-domain.dev/hc/handbook/articles/article-slug');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses hostURL when helpCenterURL is not available', () => {
|
it('uses hostURL when helpCenterURL is not available', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user