MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / get

Function get

pages/settings.ts:15–41  ·  view source on GitHub ↗
({ request, user, match, session, isRunningLocally }: RequestHandlerParams)

Source from the content-addressed store, hash-verified

13const titlePrefix = 'Settings';
14
15async function get({ request, user, match, session, isRunningLocally }: RequestHandlerParams): Promise<Response> {
16 const isExpensesAppEnabled = await AppConfig.isAppEnabled('expenses');
17 const helpEmail = (await AppConfig.getConfig()).visuals.helpEmail;
18 const isMultiFactorAuthEnabled = await AppConfig.isMultiFactorAuthEnabled();
19 const isCalendarAppEnabled = await AppConfig.isAppEnabled('calendar');
20
21 const htmlContent = defaultHtmlContent({
22 formData: {},
23 currency: user!.extra.expenses_currency,
24 timezoneId: user!.extra.timezone?.id || 'UTC',
25 isExpensesAppEnabled,
26 helpEmail,
27 isMultiFactorAuthEnabled,
28 isCalendarAppEnabled,
29 user: user!,
30 });
31
32 return basicLayoutResponse(htmlContent, {
33 currentPath: match.pathname.input,
34 titlePrefix,
35 match,
36 request,
37 user,
38 session,
39 isRunningLocally,
40 });
41}
42
43async function post({ request, user, match, session, isRunningLocally }: RequestHandlerParams): Promise<Response> {
44 const isExpensesAppEnabled = await AppConfig.isAppEnabled('expenses');

Callers

nothing calls this directly

Calls 5

basicLayoutResponseFunction · 0.90
isAppEnabledMethod · 0.80
getConfigMethod · 0.80
defaultHtmlContentFunction · 0.70

Tested by

no test coverage detected