From 4b7beb5b895108e096bba7883ade76ee29b81792 Mon Sep 17 00:00:00 2001 From: noah Date: Fri, 1 Oct 2021 17:57:20 +0900 Subject: [PATCH 1/2] Fix errors from type in UI --- ui/src/components/ApproversSelect.tsx | 4 ++-- ui/src/views/Deployment.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/components/ApproversSelect.tsx b/ui/src/components/ApproversSelect.tsx index 695a2884..d94d5f04 100644 --- a/ui/src/components/ApproversSelect.tsx +++ b/ui/src/components/ApproversSelect.tsx @@ -32,9 +32,9 @@ export default function ApproversSelect(props: ApproversSelectProps): JSX.Elemen }, 800) const _onSelectCandidate = (id: string) => { - const candidate = props.candidates.find(c => c.id.toString() ===id) + const candidate = props.candidates.find(c => c.id === parseInt(id)) if (candidate === undefined) { - return + throw new Error("The candidate is undefined.") } onSelectCandidate(candidate) diff --git a/ui/src/views/Deployment.tsx b/ui/src/views/Deployment.tsx index c146f539..2080abd9 100644 --- a/ui/src/views/Deployment.tsx +++ b/ui/src/views/Deployment.tsx @@ -101,14 +101,14 @@ export default function DeploymentView(): JSX.Element { } const onSelectCandidate = (id: string) => { - const approval = approvals.find(a => a.user?.id.toString() === id) + const approval = approvals.find(a => a.user?.id === parseInt(id)) if (approval !== undefined) { dispatch(deleteApproval(approval)) return } - const candidate = candidates.find(c => c.id.toString() === id) + const candidate = candidates.find(c => c.id === parseInt(id)) if (candidate === undefined) { throw new Error("The candidate is not found") } From 93cfbb3bed8872d0f3570f62c6839b6fc92b9208 Mon Sep 17 00:00:00 2001 From: noah Date: Fri, 1 Oct 2021 17:57:36 +0900 Subject: [PATCH 2/2] Fix params --- ui/src/redux/repoDeploy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/redux/repoDeploy.tsx b/ui/src/redux/repoDeploy.tsx index 21c1f0f6..bdbe65ba 100644 --- a/ui/src/redux/repoDeploy.tsx +++ b/ui/src/redux/repoDeploy.tsx @@ -224,7 +224,7 @@ export const addTagManually = createAsyncThunk