Skip to content

Instantly share code, notes, and snippets.

@14paxton
Created April 28, 2022 21:23
Show Gist options
  • Save 14paxton/8d0b6b33f2023fa2dff3fdd51364f8db to your computer and use it in GitHub Desktop.
Save 14paxton/8d0b6b33f2023fa2dff3fdd51364f8db to your computer and use it in GitHub Desktop.
Closure createBlockedOrHiddenMap = { Map groupedResults ->
Map blockedResults = [:]
if (groupedResults?.blockedOrHidden) {
Map mapBlockedOrHidden = groupedResults?.blockedOrHidden?.groupBy { it?.blockedOrHidden?.orderBlocked ? 'orderBlocked' : 'resultHidden' }
blockedResults = [*: mapBlockedOrHidden, 'blockedOrHiddenIds': [*mapBlockedOrHidden?.orderBlocked*.id, *mapBlockedOrHidden?.resultHidden*.id].findAll()]
}
return [*: blockedResults, "viewable": [*groupedResults?.viewable]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment