fix: Fix null value for entity config filter parameters (#22966)

This PR fixes null value issue in the computation of `evaluatedQueryParameters`.

Fixes #22949
This commit is contained in:
Ayangade Adeoluwa 2023-05-11 12:33:38 +01:00 committed by GitHub
parent 2a3bb4cf8f
commit fa9eb6497a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -385,8 +385,8 @@ class EmbeddedDatasourcePathComponent extends React.Component<
if (evaluatedPath && evaluatedPath.indexOf("?") > -1) {
evaluatedPath = extractApiUrlPath(evaluatedPath);
}
const evaluatedQueryParameters = entity.config.queryParameters
?.filter((p: KeyValuePair) => p.key)
const evaluatedQueryParameters = entity?.config?.queryParameters
?.filter((p: KeyValuePair) => !!p?.key)
.map(
(p: KeyValuePair, i: number) =>
`${i === 0 ? "?" : "&"}${p.key}=${p.value}`,