diff --git a/frontend/src/components/markdown-renderer/markdown-to-react/utils/node-to-react-transformer.tsx b/frontend/src/components/markdown-renderer/markdown-to-react/utils/node-to-react-transformer.tsx index 025f5e303..0dd07c6da 100644 --- a/frontend/src/components/markdown-renderer/markdown-to-react/utils/node-to-react-transformer.tsx +++ b/frontend/src/components/markdown-renderer/markdown-to-react/utils/node-to-react-transformer.tsx @@ -74,8 +74,7 @@ export class NodeToReactTransformer { * @return the created react element */ private translateElementToReactElement(element: Element, index: number | string): ValidReactDomElement { - const numericIndex = typeof index === 'number' ? index : Number.parseInt(index) - const elementKey = this.calculateUniqueKey(element).orElseGet(() => (-numericIndex).toString()) + const elementKey = this.calculateUniqueKey(element).orElseGet(() => `-${index}`) const replacement = this.findElementReplacement(element, elementKey) if (replacement === null) { return null diff --git a/frontend/src/pages/api/private/config.ts b/frontend/src/pages/api/private/config.ts index 48d991cfc..74973cb08 100644 --- a/frontend/src/pages/api/private/config.ts +++ b/frontend/src/pages/api/private/config.ts @@ -57,9 +57,15 @@ const initialConfig: FrontendConfig = { let currentConfig: FrontendConfig = initialConfig const handler = (req: NextApiRequest, res: NextApiResponse) => { - // This is shorter than storing the return boolean in a variable and then calling respondToTestRequest with if - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - respondToMatchingRequest(HttpMethod.GET, req, res, currentConfig, 200, false) || + const responseSuccessful = respondToMatchingRequest( + HttpMethod.GET, + req, + res, + currentConfig, + 200, + false + ) + if (!responseSuccessful) { respondToTestRequest(req, res, () => { currentConfig = { ...initialConfig, @@ -67,6 +73,7 @@ const handler = (req: NextApiRequest, res: NextApiResponse) => { } return currentConfig }) + } } export default handler