Skip to content

Commit

Permalink
Use less restrictive filter to fetch non-boolean filters (#1999)
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda authored Sep 15, 2023
1 parent 340afd7 commit 19494c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/models/related-property-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ interface PropertyPath {

export enum SuggestedFilterOperators {
AnyOf = 'any-of',
IsPresent = 'is-present'
IsPresent = 'is-present',
AtDate = 'at-date'
}

export default class RelatedPropertyPathModel extends OsfModel {
Expand Down
5 changes: 3 additions & 2 deletions lib/osf-components/addon/components/search-page/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ export default class SearchPage extends Component<SearchArgs> {
await searchResult.relatedProperties;
this.booleanFilters = searchResult.relatedProperties
.filterBy('suggestedFilterOperator', SuggestedFilterOperators.IsPresent);
this.relatedProperties = searchResult.relatedProperties
.filterBy('suggestedFilterOperator', SuggestedFilterOperators.AnyOf);
this.relatedProperties = searchResult.relatedProperties.filter(
property => property.suggestedFilterOperator !== SuggestedFilterOperators.IsPresent, // AnyOf or AtDate
);
this.firstPageCursor = searchResult.firstPageCursor;
this.nextPageCursor = searchResult.nextPageCursor;
this.prevPageCursor = searchResult.prevPageCursor;
Expand Down

0 comments on commit 19494c9

Please sign in to comment.