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/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 { - 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") }