Fix project preselection when project identifier is not defined (#9)
This commit is contained in:
committed by
Tobias Miesel
parent
1533c2261f
commit
1d2e336e3d
@@ -21,11 +21,17 @@ export const ERROR_UNKNOWN = "unknown"
|
||||
|
||||
export const noop = () => null
|
||||
|
||||
export const findProjectBy = prop => val =>
|
||||
compose(
|
||||
export const findProjectBy = prop => val => projects => {
|
||||
if (!val) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return compose(
|
||||
find(pathEq(prop, val)),
|
||||
flatMap(get("options"))
|
||||
)
|
||||
)(projects)
|
||||
}
|
||||
|
||||
export const findProjectByIdentifier = findProjectBy("identifier")
|
||||
export const findProjectByValue = findProjectBy("value")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user