Fix bug where it prints out every single entry when criterion wrong

This commit is contained in:
Bradley M. Kuhn 2022-06-21 10:14:26 -07:00
parent 022a41c131
commit c2b01e6d97

View file

@ -28,11 +28,8 @@ my $sp = new Supporters($dbh, ['none']);
my $found = 0; my $found = 0;
my(@supporterIds); my(@supporterIds);
if ($CRITERION ne 'id') { die "Can only search on id, ledgerEntityId, emailAddress" unless $CRITERION =~ /^(ledgerEntityId|emailAddress|id)$/;
@supporterIds = $sp->findDonor({$CRITERION => $SEARCH_PARAMETER }); @supporterIds = $sp->findDonor({$CRITERION => $SEARCH_PARAMETER });
} else {
push(@supporterIds, $SEARCH_PARAMETER);
}
my @requestTypes = $sp->getRequestType(); my @requestTypes = $sp->getRequestType();
foreach my $id (@supporterIds) { foreach my $id (@supporterIds) {
$found = 1; $found = 1;