From 0dcff6eb46e183e72c6390764a82fcc6dba80fd0 Mon Sep 17 00:00:00 2001 From: Anya Stasiuk Date: Tue, 3 Nov 2020 14:32:34 +0200 Subject: [PATCH] refactor: call getBasePath function once --- src/components/Endpoint/Endpoint.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Endpoint/Endpoint.tsx b/src/components/Endpoint/Endpoint.tsx index 5de8f6ac..9579eeca 100644 --- a/src/components/Endpoint/Endpoint.tsx +++ b/src/components/Endpoint/Endpoint.tsx @@ -67,7 +67,7 @@ export class Endpoint extends React.Component { const normalizedUrl = options.expandDefaultServerVariables ? expandDefaultServerVariables(server.url, server.variables) : server.url; - const basePath = getBasePath(normalizedUrl) === '/' ? '' : getBasePath(normalizedUrl); + const basePath = getBasePath(normalizedUrl); return ( @@ -75,7 +75,9 @@ export class Endpoint extends React.Component { {hideHostname || options.hideHostname - ? basePath + ? basePath === '/' + ? '' + : basePath : normalizedUrl} {operation.path}