Línea 92... |
Línea 92... |
92 |
const current_competency = competencyOptions.find(competency => competency.competency_id === selectInput.current.value)
|
92 |
const current_competency = competencyOptions.find(competency => competency.competency_id === selectInput.current.value)
|
Línea 93... |
Línea 93... |
93 |
|
93 |
|
94 |
if (competenciesSelected.some(competency => competency.competency_id === current_competency.competency_id)) {
|
94 |
if (competenciesSelected.some(competency => competency.competency_id === current_competency.competency_id)) {
|
95 |
return dispatch(addNotification({ style: 'danger', msg: 'Competencia ya agregada' }))
|
95 |
return dispatch(addNotification({ style: 'danger', msg: 'Competencia ya agregada' }))
|
- |
|
96 |
}
|
96 |
}
|
97 |
|
97 |
const competencies = new Set([...competenciesSelected])
|
98 |
const competencies = new Set([...competenciesSelected])
|
98 |
setCompetenciesSelected([current_competency, ...competencies])
|
- |
|
99 |
selectInput.current.value = ''
|
99 |
setCompetenciesSelected([current_competency, ...competencies])
|
Línea 100... |
Línea 100... |
100 |
}
|
100 |
}
|
101 |
|
101 |
|
102 |
const addSubordinates = () => {
|
102 |
const addSubordinates = () => {
|
103 |
const current_subordinate = jobsDescription.find(subordinate => subordinate.job_description_id === selectInput2.current.value)
|
103 |
const current_subordinate = jobsDescription.find(subordinate => subordinate.job_description_id === selectInput2.current.value)
|
104 |
if (current_subordinate) {
|
104 |
if (current_subordinate) {
|
105 |
const filterSubordinate = new Set([current_subordinate, ...subordinatesSelected])
|
105 |
const filterSubordinate = new Set([current_subordinate, ...subordinatesSelected])
|
106 |
setSubordinatesSelected([...filterSubordinate])
|
106 |
setSubordinatesSelected([...filterSubordinate])
|
Línea 107... |
Línea -... |
107 |
}
|
- |
|
108 |
}
|
107 |
}
|
109 |
|
- |
|
Línea 110... |
Línea -... |
110 |
const deleteCompetency = (id) => {
|
- |
|
111 |
setCompetenciesSelected(prev => prev.filter(competency => competency.competency_id !== id))
|
108 |
}
|
112 |
}
|
- |
|
Línea 113... |
Línea 109... |
113 |
|
109 |
|
114 |
const deleteSubordinate = (id) => {
|
110 |
const deleteCompetency = (id) => setCompetenciesSelected(prev => prev.filter(competency => competency.competency_id !== id))
|
115 |
setSubordinatesSelected(prev => prev.filter(subordinate => subordinate.job_description_id !== id))
|
111 |
|
116 |
}
|
112 |
const deleteSubordinate = (id) => setSubordinatesSelected(prev => prev.filter(subordinate => subordinate.job_description_id !== id))
|