diff --git a/client/src/components/DecisionSupportFilePage/OptionsSection.tsx b/client/src/components/DecisionSupportFilePage/OptionsSection.tsx index a87e4a7..7c4e256 100644 --- a/client/src/components/DecisionSupportFilePage/OptionsSection.tsx +++ b/client/src/components/DecisionSupportFilePage/OptionsSection.tsx @@ -51,23 +51,23 @@ export const OptionsSection: FunctionComponent = ({ dsf, up } const onAddOptionClick = (evt: MouseEvent) => { - var options = JSON.parse(JSON.stringify(state.section.options)) - var option = newOption("Décision", "", ""); + const options = JSON.parse(JSON.stringify(state.section.options)) + const option = newOption("Décision", "", ""); options.push(option); setState(state => ({ ...state, changed: true, section: { ...state.section, options }})); }; - const onOptionChange = (id: string, attrName: string, evt: ChangeEvent) => { + const onOptionChange = (id: number, attrName: string, evt: ChangeEvent) => { const target = evt.currentTarget; const value = target.hasOwnProperty('checked') ? target.checked : target.value; - var options = JSON.parse(JSON.stringify(state.section.options)) + const options = JSON.parse(JSON.stringify(state.section.options)) options[id][attrName] = value; setState(state => ({ ...state, changed: true, section: { ...state.section, options }})); }; - const onRemoveOptionClick = (id: string, evt: MouseEvent) => { + const onRemoveOptionClick = (id: number, evt: MouseEvent) => { if(confirm('Voulez-vous supprimer cette option ?')){ - var options = JSON.parse(JSON.stringify(state.section.options)) + const options = JSON.parse(JSON.stringify(state.section.options)) options.splice(id, 1); setState(state => ({ ...state, changed: true, section: { ...state.section, options }})); }