From bf7aa9b1e08de8b728f293f9efa90f6a447a39a0 Mon Sep 17 00:00:00 2001 From: Jerry Hogan Date: Thu, 17 Aug 2023 12:59:49 +0100 Subject: [PATCH] chore: sonar code smell fix --- .../src/constants/url.constants.ts | 14 +++++--------- cra-rxjs-styled-components/src/types/types.ts | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cra-rxjs-styled-components/src/constants/url.constants.ts b/cra-rxjs-styled-components/src/constants/url.constants.ts index 236eed3ac..3800011d6 100644 --- a/cra-rxjs-styled-components/src/constants/url.constants.ts +++ b/cra-rxjs-styled-components/src/constants/url.constants.ts @@ -85,17 +85,13 @@ export const ISSUES_PULLS_URL = ({ order: direction, }; const queryStrings = convertObjectToQueryString(params); + const milestone_check = + typeof milestone === 'string' + ? replaceEncodedSpaceWithPlus(encodeURIComponent(milestone)) + : milestone; const Q = `+is:${state}+is:${type}${ labels ? `+label:"${replaceSpaceWithPlus(labels)}"` : '' - }${ - milestone - ? `+milestone:"${ - typeof milestone === 'string' - ? replaceEncodedSpaceWithPlus(encodeURIComponent(milestone)) - : milestone - }"` - : '' - }`; + }${milestone ? `+milestone:"${milestone_check}"` : ''}`; return `${GITHUB_URL_BASE}/search/issues?q=repo:${user}/${repo}${Q}&${queryStrings}`; }; diff --git a/cra-rxjs-styled-components/src/types/types.ts b/cra-rxjs-styled-components/src/types/types.ts index 9f08eff3a..9895ebb1d 100644 --- a/cra-rxjs-styled-components/src/types/types.ts +++ b/cra-rxjs-styled-components/src/types/types.ts @@ -1,4 +1,3 @@ -// import { Issue } from "../components/issue/Issue/Issue.type"; import { Issue } from '@/components/repo-issues/Issues/Issue.type'; import { PullRequests } from '../components/pull-request/pull-request/PullRequest.type';