Skip to content

Commit

Permalink
fix: return empty list when no niscode found for postal code on stree…
Browse files Browse the repository at this point in the history
…tname list
  • Loading branch information
emalfroy authored and pgallik committed Oct 10, 2023
1 parent 8cad687 commit 29a766a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,6 @@ jobs:
, 'streetname-registry-producer-snapshot-oslo'
, 'streetname-registry-projections-backoffice'
, 'streetname-registry-snapshot-verifier'
, 'streetname-registry-consumer-read-postal'
]

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public sealed class ListHandler : ListHandlerBase
{
private readonly LegacyContext _legacyContext;
private readonly SyndicationContext _syndicationContext;
private readonly ConsumerPostalContext _PostalContext;
private readonly ConsumerPostalContext _postalContext;
private readonly IOptions<ResponseOptions> _responseOptions;

public ListHandler(
Expand All @@ -31,13 +31,13 @@ public ListHandler(
{
_legacyContext = legacyContext;
_syndicationContext = syndicationContext;
_PostalContext = postalContext;
_postalContext = postalContext;
_responseOptions = responseOptions;
}

public override async Task<StreetNameListResponse> Handle(ListRequest request, CancellationToken cancellationToken)
{
var streetNameQuery = new StreetNameListQuery(_legacyContext, _syndicationContext, _PostalContext)
var streetNameQuery = new StreetNameListQuery(_legacyContext, _syndicationContext, _postalContext)
.Fetch<StreetNameListItem, StreetNameListItem>(request.Filtering, request.Sorting, request.Pagination);

var pagedStreetNames = await streetNameQuery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ protected override IQueryable<StreetNameListItem> Filter(FilteringHeader<StreetN
{
streetNames = streetNames.Where(m => m.NisCode == postalConsumerItem.NisCode);
}
else
{
streetNames = streetNames.Where(m => m.NisCode == "-1");
}
}

return streetNames;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ protected override IQueryable<StreetNameListItemV2> Filter(FilteringHeader<Stree
{
streetNames = streetNames.Where(m => m.NisCode == postalConsumerItem.NisCode);
}
else
{
streetNames = streetNames.Where(m => m.NisCode == "-1");
}
}

return streetNames;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ protected override IQueryable<StreetNameListItem> Filter(FilteringHeader<StreetN
{
streetNames = streetNames.Where(m => m.NisCode == postalConsumerItem.NisCode);
}
else
{
streetNames = streetNames.Where(m => m.NisCode == "-1");
}
}

return streetNames;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ protected override IQueryable<StreetNameListItemV2> Filter(FilteringHeader<Stree
{
streetNames = streetNames.Where(m => m.NisCode == postalConsumerItem.NisCode);
}
else
{
streetNames = streetNames.Where(m => m.NisCode == "-1");
}
}

return streetNames;
Expand Down

0 comments on commit 29a766a

Please sign in to comment.