Skip to content

Commit

Permalink
psp-8545 Correct behaviour when there is no property ownership specif…
Browse files Browse the repository at this point in the history
…ied. (#4149)

Co-authored-by: Alejandro Sanchez <[email protected]>
  • Loading branch information
devinleighsmith and asanchezr committed Jul 4, 2024
1 parent e0ddd62 commit a550827
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static ExpressionStarter<PimsPropertyVw> GenerateCommonPropertyQuery(Pim

ExpressionStarter<PimsPropertyVw> ownershipBuilder;

if (filter.Ownership.Count > 0)
if (filter.Ownership.Count > 0 && filter.Ownership.FirstOrDefault() != string.Empty)
{
// Property ownership filters
ownershipBuilder = isRetired ? PredicateBuilder.New<PimsPropertyVw>(p => p.IsRetired == true) : PredicateBuilder.New<PimsPropertyVw>(p => false);
Expand Down
5 changes: 2 additions & 3 deletions source/backend/dal/Repositories/PropertyRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ public HashSet<long> GetMatchingIds(PropertyFilterCriteria filter)
p.PimsPropPropAnomalyTypes.Any(at => filter.AnomalyIds.Contains(at.PropertyAnomalyTypeCode)));
}


var authorizationTypes = new List<string>(){
var authorizationTypes = new List<string>()
{
"NOI",
"Section 15",
"Section 16",
Expand Down Expand Up @@ -567,7 +567,6 @@ public HashSet<long> GetMatchingIds(PropertyFilterCriteria filter)
{
predicate.And(ownershipBuilder); // Only apply ownership filter if at least one type is specified.
}
predicate.And(ownershipBuilder);

return Context.PimsProperties.AsNoTracking()
.Where(predicate)
Expand Down

0 comments on commit a550827

Please sign in to comment.