diff --git a/frontend/src/pages/admin/config/[category].tsx b/frontend/src/pages/admin/config/[category].tsx index cafd0ea..23b64b8 100644 --- a/frontend/src/pages/admin/config/[category].tsx +++ b/frontend/src/pages/admin/config/[category].tsx @@ -72,6 +72,10 @@ export default function AppShellDemo() { }; const updateConfigVariable = (configVariable: UpdateConfig) => { + if (configVariable.key === 'general.appUrl') { + configVariable.value = sanitizeUrl(configVariable.value); + } + const index = updatedConfigVariables.findIndex( (item) => item.key === configVariable.key, ); @@ -86,6 +90,10 @@ export default function AppShellDemo() { } }; + const sanitizeUrl = (url: string): string => { + return url.endsWith('/') ? url.slice(0, -1) : url; + }; + useEffect(() => { configService.getByCategory(categoryId).then((configVariables) => { setConfigVariables(configVariables);