({ request, user, match, session, isRunningLocally }: RequestHandlerParams)
| 13 | const titlePrefix = 'Settings'; |
| 14 | |
| 15 | async 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 | |
| 43 | async function post({ request, user, match, session, isRunningLocally }: RequestHandlerParams): Promise<Response> { |
| 44 | const isExpensesAppEnabled = await AppConfig.isAppEnabled('expenses'); |
nothing calls this directly
no test coverage detected