From ca2312b80991156be1bc77ac2bf11f4743483194 Mon Sep 17 00:00:00 2001 From: grimsi <9295182+grimsi@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:55:15 +0200 Subject: [PATCH] Minor refactoring --- .../frontend/components/administration/withConfigPage.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/components/administration/withConfigPage.tsx b/src/main/frontend/components/administration/withConfigPage.tsx index adc25b3..c936093 100644 --- a/src/main/frontend/components/administration/withConfigPage.tsx +++ b/src/main/frontend/components/administration/withConfigPage.tsx @@ -33,18 +33,18 @@ export default function withConfigPage(WrappedComponent: React.ComponentType { const configValues = toConfigValuePair(values); await ConfigEndpoint.setAll(configValues); setNestedConfigDtos(values); setConfigSaved(true); } - function getConfig(key: string) { + function getConfig(key: string): ConfigEntryDto | undefined { return configDtos.find((configDto: ConfigEntryDto) => configDto.key === key); } - function getConfigs(prefix: string) { + function getConfigs(prefix: string): ConfigEntryDto[] { return configDtos.filter((configDto: ConfigEntryDto) => configDto.key?.startsWith(prefix)); } @@ -106,7 +106,7 @@ export default function withConfigPage(WrappedComponent: React.ComponentType + [...Array(4)].map((_e, i) =>