It is always returning an empty array. It should only return ids and titles where the id of the drawsTRFormIdAndTitleSelector is === the transactionRequestFormId of the drawTRSelector
export const idAndTitleSelector = createSelector(
drawTRSelector,
drawsTRFormIdAndTitleSelector,
(transactionRequests, idAndTitle) =>
idAndTitle.filter(
({ id }) => id === transactionRequests.transactionRequestFormId
)
);
drawTRSelector returns an array of objects that looks like:
[{
id: "1",
number: "1",
transactionRequestFormId: "1",
}]
drawsTRFormIdAndTitleSelector returns an array of objects that looks like:
[{
id: "1",
title: "TR All Others",
}]