Group income notifs by source title

This commit is contained in:
Ian Philips 2022-07-11 08:11:52 -06:00
parent 86c256cbf7
commit 52d688885d

View File

@ -179,15 +179,16 @@ function IncomeNotificationGroupItem(props: {
(n) => n.sourceType
)
for (const sourceType in groupedNotificationsBySourceType) {
const groupedNotificationsByContractId = groupBy(
// Source title splits by contracts and groups
const groupedNotificationsBySourceTitle = groupBy(
groupedNotificationsBySourceType[sourceType],
(notification) => {
return notification.sourceContractId
return notification.sourceTitle
}
)
for (const contractId in groupedNotificationsByContractId) {
for (const contractId in groupedNotificationsBySourceTitle) {
const notificationsForContractId =
groupedNotificationsByContractId[contractId]
groupedNotificationsBySourceTitle[contractId]
if (notificationsForContractId.length === 1) {
newNotifications.push(notificationsForContractId[0])
continue