alan
6 years ago
6 changed files with 28 additions and 8 deletions
@ -0,0 +1,20 @@ |
|||||||
|
import {LinkType} from '@ui/type'; |
||||||
|
|
||||||
|
export function getDrivers(linkSelected: LinkType): {text: string; value: string}[] { |
||||||
|
const drivers: {text: string; value: string}[] = []; |
||||||
|
if (linkSelected.drivers.length > 0) { |
||||||
|
linkSelected.drivers.forEach(item => { |
||||||
|
drivers.push({ |
||||||
|
text: item, |
||||||
|
value: item, |
||||||
|
}); |
||||||
|
}); |
||||||
|
} else { |
||||||
|
drivers.push({ |
||||||
|
text: linkSelected.driver, |
||||||
|
value: linkSelected.driver, |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
return drivers; |
||||||
|
} |
Loading…
Reference in new issue