Convert Array<Location | undefined> to Array<Location>

This commit is contained in:
Sebastian Qvarfordt
2020-06-03 11:10:51 +02:00
parent a47ebf902f
commit 241a5a8944
@@ -73,7 +73,10 @@ const CatalogPage: FC<{}> = () => {
if (value) {
getLocationDataForEntities(value)
.then(location => location.filter(l => !!l))
.then(
(location): Location[] =>
location.filter(l => !!l) as Array<Location>,
)
.then(setLocations);
}
}, [value, catalogApi]);