Skip to content

Commit 43b132c

Browse files
committed
support page
1 parent fc8a256 commit 43b132c

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { createLogger } from '@obp/shared/utils';
2+
const logger = createLogger('SupportPage');
3+
import { obp_requests } from '$lib/obp/requests';
4+
5+
const DEFAULT_SUPPORT_PLATFORM_URL = 'https://chat.openbankproject.com';
6+
7+
interface WebUIProp {
8+
name: string;
9+
value: string;
10+
}
11+
12+
export async function load() {
13+
let supportPlatformUrl = DEFAULT_SUPPORT_PLATFORM_URL;
14+
15+
try {
16+
const json = await obp_requests.get('/obp/v6.0.0/webui-props?active=true');
17+
const prop = (json?.webui_props as WebUIProp[] | undefined)?.find(
18+
(p) => p.name === 'webui_support_platform_url'
19+
);
20+
if (prop?.value) {
21+
supportPlatformUrl = prop.value;
22+
}
23+
} catch (e) {
24+
// Public page must render even if OBP-API is unreachable; fall back to the default.
25+
logger.warn('Could not fetch webui_support_platform_url, using default:', e);
26+
}
27+
28+
return { supportPlatformUrl };
29+
}

0 commit comments

Comments
 (0)