You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
374 B
19 lines
374 B
1 year ago
|
import { reduce } from 'lodash';
|
||
|
import { SelectedState } from 'Helpers/Hooks/useSelectState';
|
||
|
|
||
|
function getSelectedIds(selectedState: SelectedState): number[] {
|
||
|
return reduce(
|
||
|
selectedState,
|
||
|
(result: number[], value, id) => {
|
||
|
if (value) {
|
||
|
result.push(parseInt(id));
|
||
|
}
|
||
|
|
||
|
return result;
|
||
|
},
|
||
|
[]
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default getSelectedIds;
|