Skip to content

Commit

Permalink
Add back accessService to SHARE request
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda committed Oct 2, 2023
1 parent edb709b commit 555c44d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/osf-components/addon/components/search-page/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Store from '@ember-data/store';
import { action } from '@ember/object';
import Media from 'ember-responsive';

import config from 'ember-osf-web/config/environment';
import { ShareMoreThanTenThousand } from 'ember-osf-web/models/index-card-search';
import SearchResultModel from 'ember-osf-web/models/search-result';
import ProviderModel from 'ember-osf-web/models/provider';
Expand Down Expand Up @@ -66,6 +67,7 @@ interface SearchArgs {
activeFilters: Filter[];
}

const osfURL = config.OSF.url;
const searchDebounceTime = 100;

export default class SearchPage extends Component<SearchArgs> {
Expand Down Expand Up @@ -219,6 +221,10 @@ export default class SearchPage extends Component<SearchArgs> {
resourceTypeFilter = Object.values(ResourceTypeFilterValue).join(',');
}
filterQueryObject['resourceType'] = resourceTypeFilter;
// Add the accessService if we are not serving locally
if (!osfURL.includes('localhost')) {
filterQueryObject['accessService'] = osfURL; // Only fetch items from the current OSF environment
}
filterQueryObject = { ...filterQueryObject, ...this.args.defaultQueryOptions };
this.filterQueryObject = filterQueryObject;
const searchResult = await this.store.queryRecord('index-card-search', {
Expand Down

0 comments on commit 555c44d

Please sign in to comment.