This repository was archived by the owner on May 30, 2024. It is now read-only.
File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ export default function ApproversSelect(props: ApproversSelectProps): JSX.Elemen
32
32
} , 800 )
33
33
34
34
const _onSelectCandidate = ( id : string ) => {
35
- const candidate = props . candidates . find ( c => c . id . toString ( ) === id )
35
+ const candidate = props . candidates . find ( c => c . id === parseInt ( id ) )
36
36
if ( candidate === undefined ) {
37
- return
37
+ throw new Error ( "The candidate is undefined." )
38
38
}
39
39
40
40
onSelectCandidate ( candidate )
Original file line number Diff line number Diff line change @@ -101,14 +101,14 @@ export default function DeploymentView(): JSX.Element {
101
101
}
102
102
103
103
const onSelectCandidate = ( id : string ) => {
104
- const approval = approvals . find ( a => a . user ?. id . toString ( ) === id )
104
+ const approval = approvals . find ( a => a . user ?. id === parseInt ( id ) )
105
105
106
106
if ( approval !== undefined ) {
107
107
dispatch ( deleteApproval ( approval ) )
108
108
return
109
109
}
110
110
111
- const candidate = candidates . find ( c => c . id . toString ( ) === id )
111
+ const candidate = candidates . find ( c => c . id === parseInt ( id ) )
112
112
if ( candidate === undefined ) {
113
113
throw new Error ( "The candidate is not found" )
114
114
}
You can’t perform that action at this time.
0 commit comments